effect
stringclasses
48 values
original_source_type
stringlengths
0
23k
opens_and_abbrevs
listlengths
2
92
isa_cross_project_example
bool
1 class
source_definition
stringlengths
9
57.9k
partial_definition
stringlengths
7
23.3k
is_div
bool
2 classes
is_type
null
is_proof
bool
2 classes
completed_definiton
stringlengths
1
250k
dependencies
dict
effect_flags
sequencelengths
0
2
ideal_premises
sequencelengths
0
236
mutual_with
sequencelengths
0
11
file_context
stringlengths
0
407k
interleaved
bool
1 class
is_simply_typed
bool
2 classes
file_name
stringlengths
5
48
vconfig
dict
is_simple_lemma
null
source_type
stringlengths
10
23k
proof_features
sequencelengths
0
1
name
stringlengths
8
95
source
dict
verbose_type
stringlengths
1
7.42k
source_range
dict
Prims.Tot
[ { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lattice_element (sl: sl) = Ghost.erased (SemiLattice?.carrier (Ghost.reveal sl))
let lattice_element (sl: sl) =
false
null
false
Ghost.erased (SemiLattice?.carrier (Ghost.reveal sl))
{ "checked_file": "FStar.IFC.fsti.checked", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "FStar.IFC.fsti" }
[ "total" ]
[ "FStar.IFC.sl", "FStar.Ghost.erased", "FStar.IFC.__proj__SemiLattice__item__carrier", "FStar.Ghost.reveal", "FStar.IFC.semilattice" ]
[]
(* 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.IFC /// FStar.IFC provides a simple, generic abstraction for monadic /// information-flow control based on a user-defined (semi-)lattice of /// information flow labels. /// /// The main idea is to provide an abstract type [protected a l], /// encapsulating values of type [a] carrying information at /// confidentiality level [l]. Operations that compute on the /// underlying [a] are instrumented to reflect the sensitivity of /// their arguments on their results. /// /// Several papers develop this idea, ranging from /// /// Fable: A language for enforcing user-defined security policies /// http://www.cs.umd.edu/~nswamy/papers/fable-tr.pdf /// /// To more modern variants like /// https://hackage.haskell.org/package/lio (**** Basic definitions for a join semilattice *) (** The [lub] is associative *) let associative #a (f: (a -> a -> a)) = forall x y z. f (f x y) z == f x (f y z) (** The [lub] is commutative *) let commutative #a (f: (a -> a -> a)) = forall x y. f x y == f y x (** The [lub] is idempotent *) let idempotent #a (f: (a -> a -> a)) = forall x. f x x == x (** A semilattice has a top element and a associative-commutative-idempotent least upper bound operator. This is effectively the typeclass of a semilattice, however, we program explicitly with semilattice, rather than use typeclass instantiation. *) noeq type semilattice : Type u#(c + 1) = | SemiLattice : #carrier: Type u#c -> top: carrier -> lub: (f: (carrier -> carrier -> carrier){associative f /\ commutative f /\ idempotent f}) -> semilattice (** For most of the rest of this development, we'll use an erased counterpart of a semilattice *) let sl:Type u#(c + 1) = FStar.Ghost.erased semilattice
false
true
FStar.IFC.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lattice_element : sl: FStar.IFC.sl -> Type
[]
FStar.IFC.lattice_element
{ "file_name": "ulib/FStar.IFC.fsti", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
sl: FStar.IFC.sl -> Type
{ "end_col": 84, "end_line": 66, "start_col": 31, "start_line": 66 }
Prims.Tot
val sl:Type u#(c + 1)
[ { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let sl:Type u#(c + 1) = FStar.Ghost.erased semilattice
val sl:Type u#(c + 1) let sl:Type u#(c + 1) =
false
null
false
FStar.Ghost.erased semilattice
{ "checked_file": "FStar.IFC.fsti.checked", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "FStar.IFC.fsti" }
[ "total" ]
[ "FStar.Ghost.erased", "FStar.IFC.semilattice" ]
[]
(* 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.IFC /// FStar.IFC provides a simple, generic abstraction for monadic /// information-flow control based on a user-defined (semi-)lattice of /// information flow labels. /// /// The main idea is to provide an abstract type [protected a l], /// encapsulating values of type [a] carrying information at /// confidentiality level [l]. Operations that compute on the /// underlying [a] are instrumented to reflect the sensitivity of /// their arguments on their results. /// /// Several papers develop this idea, ranging from /// /// Fable: A language for enforcing user-defined security policies /// http://www.cs.umd.edu/~nswamy/papers/fable-tr.pdf /// /// To more modern variants like /// https://hackage.haskell.org/package/lio (**** Basic definitions for a join semilattice *) (** The [lub] is associative *) let associative #a (f: (a -> a -> a)) = forall x y z. f (f x y) z == f x (f y z) (** The [lub] is commutative *) let commutative #a (f: (a -> a -> a)) = forall x y. f x y == f y x (** The [lub] is idempotent *) let idempotent #a (f: (a -> a -> a)) = forall x. f x x == x (** A semilattice has a top element and a associative-commutative-idempotent least upper bound operator. This is effectively the typeclass of a semilattice, however, we program explicitly with semilattice, rather than use typeclass instantiation. *) noeq type semilattice : Type u#(c + 1) = | SemiLattice : #carrier: Type u#c -> top: carrier -> lub: (f: (carrier -> carrier -> carrier){associative f /\ commutative f /\ idempotent f}) -> semilattice (** For most of the rest of this development, we'll use an erased
false
true
FStar.IFC.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val sl:Type u#(c + 1)
[]
FStar.IFC.sl
{ "file_name": "ulib/FStar.IFC.fsti", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
Type
{ "end_col": 54, "end_line": 63, "start_col": 24, "start_line": 63 }
Prims.Tot
val lub (#sl: _) (x y: lattice_element sl) : Tot (lattice_element sl)
[ { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lub #sl (x: lattice_element sl) (y: lattice_element sl) : Tot (lattice_element sl) = Ghost.hide (SemiLattice?.lub (Ghost.reveal sl) (Ghost.reveal x) (Ghost.reveal y))
val lub (#sl: _) (x y: lattice_element sl) : Tot (lattice_element sl) let lub #sl (x: lattice_element sl) (y: lattice_element sl) : Tot (lattice_element sl) =
false
null
false
Ghost.hide (SemiLattice?.lub (Ghost.reveal sl) (Ghost.reveal x) (Ghost.reveal y))
{ "checked_file": "FStar.IFC.fsti.checked", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "FStar.IFC.fsti" }
[ "total" ]
[ "FStar.IFC.sl", "FStar.IFC.lattice_element", "FStar.Ghost.hide", "FStar.IFC.__proj__SemiLattice__item__carrier", "FStar.Ghost.reveal", "FStar.IFC.semilattice", "FStar.IFC.__proj__SemiLattice__item__lub" ]
[]
(* 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.IFC /// FStar.IFC provides a simple, generic abstraction for monadic /// information-flow control based on a user-defined (semi-)lattice of /// information flow labels. /// /// The main idea is to provide an abstract type [protected a l], /// encapsulating values of type [a] carrying information at /// confidentiality level [l]. Operations that compute on the /// underlying [a] are instrumented to reflect the sensitivity of /// their arguments on their results. /// /// Several papers develop this idea, ranging from /// /// Fable: A language for enforcing user-defined security policies /// http://www.cs.umd.edu/~nswamy/papers/fable-tr.pdf /// /// To more modern variants like /// https://hackage.haskell.org/package/lio (**** Basic definitions for a join semilattice *) (** The [lub] is associative *) let associative #a (f: (a -> a -> a)) = forall x y z. f (f x y) z == f x (f y z) (** The [lub] is commutative *) let commutative #a (f: (a -> a -> a)) = forall x y. f x y == f y x (** The [lub] is idempotent *) let idempotent #a (f: (a -> a -> a)) = forall x. f x x == x (** A semilattice has a top element and a associative-commutative-idempotent least upper bound operator. This is effectively the typeclass of a semilattice, however, we program explicitly with semilattice, rather than use typeclass instantiation. *) noeq type semilattice : Type u#(c + 1) = | SemiLattice : #carrier: Type u#c -> top: carrier -> lub: (f: (carrier -> carrier -> carrier){associative f /\ commutative f /\ idempotent f}) -> semilattice (** For most of the rest of this development, we'll use an erased counterpart of a semilattice *) let sl:Type u#(c + 1) = FStar.Ghost.erased semilattice (** A lattice element is just an element of the carrier type *) let lattice_element (sl: sl) = Ghost.erased (SemiLattice?.carrier (Ghost.reveal sl)) (** A convenience for joining elements in the lattice *) unfold
false
false
FStar.IFC.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lub (#sl: _) (x y: lattice_element sl) : Tot (lattice_element sl)
[]
FStar.IFC.lub
{ "file_name": "ulib/FStar.IFC.fsti", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
x: FStar.IFC.lattice_element sl -> y: FStar.IFC.lattice_element sl -> FStar.IFC.lattice_element sl
{ "end_col": 83, "end_line": 71, "start_col": 2, "start_line": 71 }
Prims.Tot
val return (#sl #a: _) (l: lattice_element sl) (x: a) : protected l a
[ { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let return #sl #a (l: lattice_element sl) (x: a) : protected l a = hide x
val return (#sl #a: _) (l: lattice_element sl) (x: a) : protected l a let return #sl #a (l: lattice_element sl) (x: a) : protected l a =
false
null
false
hide x
{ "checked_file": "FStar.IFC.fsti.checked", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "FStar.IFC.fsti" }
[ "total" ]
[ "FStar.IFC.sl", "FStar.IFC.lattice_element", "FStar.IFC.hide", "FStar.IFC.protected" ]
[]
(* 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.IFC /// FStar.IFC provides a simple, generic abstraction for monadic /// information-flow control based on a user-defined (semi-)lattice of /// information flow labels. /// /// The main idea is to provide an abstract type [protected a l], /// encapsulating values of type [a] carrying information at /// confidentiality level [l]. Operations that compute on the /// underlying [a] are instrumented to reflect the sensitivity of /// their arguments on their results. /// /// Several papers develop this idea, ranging from /// /// Fable: A language for enforcing user-defined security policies /// http://www.cs.umd.edu/~nswamy/papers/fable-tr.pdf /// /// To more modern variants like /// https://hackage.haskell.org/package/lio (**** Basic definitions for a join semilattice *) (** The [lub] is associative *) let associative #a (f: (a -> a -> a)) = forall x y z. f (f x y) z == f x (f y z) (** The [lub] is commutative *) let commutative #a (f: (a -> a -> a)) = forall x y. f x y == f y x (** The [lub] is idempotent *) let idempotent #a (f: (a -> a -> a)) = forall x. f x x == x (** A semilattice has a top element and a associative-commutative-idempotent least upper bound operator. This is effectively the typeclass of a semilattice, however, we program explicitly with semilattice, rather than use typeclass instantiation. *) noeq type semilattice : Type u#(c + 1) = | SemiLattice : #carrier: Type u#c -> top: carrier -> lub: (f: (carrier -> carrier -> carrier){associative f /\ commutative f /\ idempotent f}) -> semilattice (** For most of the rest of this development, we'll use an erased counterpart of a semilattice *) let sl:Type u#(c + 1) = FStar.Ghost.erased semilattice (** A lattice element is just an element of the carrier type *) let lattice_element (sl: sl) = Ghost.erased (SemiLattice?.carrier (Ghost.reveal sl)) (** A convenience for joining elements in the lattice *) unfold let lub #sl (x: lattice_element sl) (y: lattice_element sl) : Tot (lattice_element sl) = Ghost.hide (SemiLattice?.lub (Ghost.reveal sl) (Ghost.reveal x) (Ghost.reveal y)) (** The main type provided by this module is [protected l b] i.e,, a [b]-typed value protected at IFC level [l]. [protected b l] is in a bijection with [b], as shown by [reveal] and [hide] below *) val protected (#sl: sl u#c) (l: lattice_element sl) (b: Type u#b) : Type u#b (** [reveal] projects a [b] from a [protected b l], but incurs a ghost effect *) val reveal (#sl: _) (#l: lattice_element sl) (#b: _) (x: protected l b) : GTot b (** [hide] injects a [b] into a [protected b l]. Note, any [b] can be promoted to a [protected l b] i.e., [protected l b] is only meant to enforce confidentiality *) val hide (#sl: _) (#l: lattice_element sl) (#b: _) (x: b) : Tot (protected l b) (** The next pair of lemmas show that reveal/hide are inverses *) val reveal_hide (#l #t #b: _) (x: b) : Lemma (reveal (hide #l #t x) == x) [SMTPat (hide #l #t x)] val hide_reveal (#sl: _) (#l: lattice_element sl) (#b: _) (x: protected l b) : Lemma (hide (reveal x) == x) [SMTPat (reveal x)] /// [protected l b] is a form of parameterized monad /// It provides: /// -- [return] (via [hide]) /// -- [map] (i.e., it's a functor) /// -- [join] (so it's also a monad) /// Which we package up as a [bind]
false
false
FStar.IFC.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val return (#sl #a: _) (l: lattice_element sl) (x: a) : protected l a
[]
FStar.IFC.return
{ "file_name": "ulib/FStar.IFC.fsti", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
l: FStar.IFC.lattice_element sl -> x: a -> FStar.IFC.protected l a
{ "end_col": 73, "end_line": 103, "start_col": 67, "start_line": 103 }
Prims.Tot
val op_let_Greater_Greater (#sl: _) (#l1: lattice_element sl) (#a: _) (x: protected l1 a) (#l2: lattice_element sl) (#b: _) (f: (y: a{y == reveal x} -> protected l2 b)) : Tot (protected (l1 `lub` l2) b)
[ { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let (let>>) #sl (#l1: lattice_element sl) #a (x: protected l1 a) (#l2: lattice_element sl) #b (f: (y: a{y == reveal x} -> protected l2 b)) : Tot (protected (l1 `lub` l2) b) = join (map x f)
val op_let_Greater_Greater (#sl: _) (#l1: lattice_element sl) (#a: _) (x: protected l1 a) (#l2: lattice_element sl) (#b: _) (f: (y: a{y == reveal x} -> protected l2 b)) : Tot (protected (l1 `lub` l2) b) let op_let_Greater_Greater #sl (#l1: lattice_element sl) #a (x: protected l1 a) (#l2: lattice_element sl) #b (f: (y: a{y == reveal x} -> protected l2 b)) : Tot (protected (l1 `lub` l2) b) =
false
null
false
join (map x f)
{ "checked_file": "FStar.IFC.fsti.checked", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "FStar.IFC.fsti" }
[ "total" ]
[ "FStar.IFC.sl", "FStar.IFC.lattice_element", "FStar.IFC.protected", "Prims.eq2", "FStar.IFC.reveal", "FStar.IFC.join", "FStar.IFC.map", "FStar.IFC.lub" ]
[]
(* 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.IFC /// FStar.IFC provides a simple, generic abstraction for monadic /// information-flow control based on a user-defined (semi-)lattice of /// information flow labels. /// /// The main idea is to provide an abstract type [protected a l], /// encapsulating values of type [a] carrying information at /// confidentiality level [l]. Operations that compute on the /// underlying [a] are instrumented to reflect the sensitivity of /// their arguments on their results. /// /// Several papers develop this idea, ranging from /// /// Fable: A language for enforcing user-defined security policies /// http://www.cs.umd.edu/~nswamy/papers/fable-tr.pdf /// /// To more modern variants like /// https://hackage.haskell.org/package/lio (**** Basic definitions for a join semilattice *) (** The [lub] is associative *) let associative #a (f: (a -> a -> a)) = forall x y z. f (f x y) z == f x (f y z) (** The [lub] is commutative *) let commutative #a (f: (a -> a -> a)) = forall x y. f x y == f y x (** The [lub] is idempotent *) let idempotent #a (f: (a -> a -> a)) = forall x. f x x == x (** A semilattice has a top element and a associative-commutative-idempotent least upper bound operator. This is effectively the typeclass of a semilattice, however, we program explicitly with semilattice, rather than use typeclass instantiation. *) noeq type semilattice : Type u#(c + 1) = | SemiLattice : #carrier: Type u#c -> top: carrier -> lub: (f: (carrier -> carrier -> carrier){associative f /\ commutative f /\ idempotent f}) -> semilattice (** For most of the rest of this development, we'll use an erased counterpart of a semilattice *) let sl:Type u#(c + 1) = FStar.Ghost.erased semilattice (** A lattice element is just an element of the carrier type *) let lattice_element (sl: sl) = Ghost.erased (SemiLattice?.carrier (Ghost.reveal sl)) (** A convenience for joining elements in the lattice *) unfold let lub #sl (x: lattice_element sl) (y: lattice_element sl) : Tot (lattice_element sl) = Ghost.hide (SemiLattice?.lub (Ghost.reveal sl) (Ghost.reveal x) (Ghost.reveal y)) (** The main type provided by this module is [protected l b] i.e,, a [b]-typed value protected at IFC level [l]. [protected b l] is in a bijection with [b], as shown by [reveal] and [hide] below *) val protected (#sl: sl u#c) (l: lattice_element sl) (b: Type u#b) : Type u#b (** [reveal] projects a [b] from a [protected b l], but incurs a ghost effect *) val reveal (#sl: _) (#l: lattice_element sl) (#b: _) (x: protected l b) : GTot b (** [hide] injects a [b] into a [protected b l]. Note, any [b] can be promoted to a [protected l b] i.e., [protected l b] is only meant to enforce confidentiality *) val hide (#sl: _) (#l: lattice_element sl) (#b: _) (x: b) : Tot (protected l b) (** The next pair of lemmas show that reveal/hide are inverses *) val reveal_hide (#l #t #b: _) (x: b) : Lemma (reveal (hide #l #t x) == x) [SMTPat (hide #l #t x)] val hide_reveal (#sl: _) (#l: lattice_element sl) (#b: _) (x: protected l b) : Lemma (hide (reveal x) == x) [SMTPat (reveal x)] /// [protected l b] is a form of parameterized monad /// It provides: /// -- [return] (via [hide]) /// -- [map] (i.e., it's a functor) /// -- [join] (so it's also a monad) /// Which we package up as a [bind] unfold let return #sl #a (l: lattice_element sl) (x: a) : protected l a = hide x (** This is just a map of [f] over [x] But, notice the order of arguments is flipped We write [map x f] instead of [map f x] so that [f]'s type can depend on [x] *) val map (#a #b #sl: _) (#l: lattice_element sl) (x: protected l a) (f: (y: a{y == reveal x} -> b)) : Tot (y: protected l b {reveal y == f (reveal x)}) (** This is almost a regular monadic [join] Except notice that the label of the result is the [lub] of the both the labels in the argument *) val join (#sl: _) (#l1 #l2: lattice_element sl) (#a: _) (x: protected l1 (protected l2 a)) : Tot (y: protected (l1 `lub` l2) a {reveal y == reveal (reveal x)}) (** This is almost like a regular bind, except like [map] the type of the continuation's argument depends on the argument [x]; and, like [join], the indexes on the result are at least as high as the indexes of the argument As such, any computation that observes the protected value held in [x] has a secrecy level at least as secret as [x] itself *) unfold let (let>>) #sl (#l1: lattice_element sl) #a (x: protected l1 a) (#l2: lattice_element sl) #b
false
false
FStar.IFC.fsti
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val op_let_Greater_Greater (#sl: _) (#l1: lattice_element sl) (#a: _) (x: protected l1 a) (#l2: lattice_element sl) (#b: _) (f: (y: a{y == reveal x} -> protected l2 b)) : Tot (protected (l1 `lub` l2) b)
[]
FStar.IFC.op_let_Greater_Greater
{ "file_name": "ulib/FStar.IFC.fsti", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
x: FStar.IFC.protected l1 a -> f: (y: a{y == FStar.IFC.reveal x} -> FStar.IFC.protected l2 b) -> FStar.IFC.protected (FStar.IFC.lub l1 l2) b
{ "end_col": 54, "end_line": 133, "start_col": 40, "start_line": 133 }
Prims.Tot
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let uint8_t = U8.t
let uint8_t =
false
null
false
U8.t
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[ "total" ]
[ "FStar.UInt8.t" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec
false
true
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val uint8_t : Prims.eqtype
[]
MerkleTree.Low.Serialization.uint8_t
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
Prims.eqtype
{ "end_col": 18, "end_line": 33, "start_col": 14, "start_line": 33 }
FStar.HyperStack.ST.ST
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let serialize_offset_t = serialize_uint64_t
let serialize_offset_t =
true
null
false
serialize_uint64_t
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Serialization.serialize_uint64_t" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val serialize_offset_t : ok: Prims.bool -> x: MerkleTree.Low.Serialization.uint64_t -> buf: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.Monotonic.Buffer.len buf = sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
[]
MerkleTree.Low.Serialization.serialize_offset_t
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> x: MerkleTree.Low.Serialization.uint64_t -> buf: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.Monotonic.Buffer.len buf = sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 51, "end_line": 80, "start_col": 33, "start_line": 80 }
Prims.Tot
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let uint8_p = B.buffer uint8_t
let uint8_p =
false
null
false
B.buffer uint8_t
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[ "total" ]
[ "LowStar.Buffer.buffer", "MerkleTree.Low.Serialization.uint8_t" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t
false
true
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val uint8_p : Type0
[]
MerkleTree.Low.Serialization.uint8_p
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
Type0
{ "end_col": 30, "end_line": 38, "start_col": 14, "start_line": 38 }
Prims.Tot
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let uint32_t = U32.t
let uint32_t =
false
null
false
U32.t
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[ "total" ]
[ "FStar.UInt32.t" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t
false
true
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val uint32_t : Prims.eqtype
[]
MerkleTree.Low.Serialization.uint32_t
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
Prims.eqtype
{ "end_col": 20, "end_line": 35, "start_col": 15, "start_line": 35 }
FStar.HyperStack.ST.ST
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let serialize_index_t = serialize_uint32_t
let serialize_index_t =
true
null
false
serialize_uint32_t
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Serialization.serialize_uint32_t" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val serialize_index_t : ok: Prims.bool -> x: MerkleTree.Low.Serialization.uint32_t -> buf: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.Monotonic.Buffer.len buf = sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
[]
MerkleTree.Low.Serialization.serialize_index_t
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> x: MerkleTree.Low.Serialization.uint32_t -> buf: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.Monotonic.Buffer.len buf = sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 50, "end_line": 81, "start_col": 32, "start_line": 81 }
Prims.Tot
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let uint16_t = U16.t
let uint16_t =
false
null
false
U16.t
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[ "total" ]
[ "FStar.UInt16.t" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec
false
true
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val uint16_t : Prims.eqtype
[]
MerkleTree.Low.Serialization.uint16_t
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
Prims.eqtype
{ "end_col": 20, "end_line": 34, "start_col": 15, "start_line": 34 }
FStar.HyperStack.ST.ST
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let deserialize_offset_t = deserialize_uint64_t
let deserialize_offset_t =
true
null
false
deserialize_uint64_t
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Serialization.deserialize_uint64_t" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end private let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with| 0uy -> false | _ -> true)) private let deserialize_uint8_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0uy) else (true, pos + 1ul, CB.index buf pos) private let deserialize_uint16_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0us) else begin let ok, pos, b0 = deserialize_uint8_t ok buf sz pos in let ok, pos, b1 = deserialize_uint8_t ok buf sz pos in (ok, pos, (U16.shift_left (Int.Cast.uint8_to_uint16 b0) 8ul) + Int.Cast.uint8_to_uint16 b1) end private let deserialize_uint32_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0ul) else begin let ok, pos, b0 = deserialize_uint16_t ok buf sz pos in let ok, pos, b1 = deserialize_uint16_t ok buf sz pos in (ok, pos, (U32.shift_left (Int.Cast.uint16_to_uint32 b0) 16ul) + Int.Cast.uint16_to_uint32 b1) end private let deserialize_uint64_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0UL) else begin let ok, pos, b0 = deserialize_uint32_t ok buf sz pos in let ok, pos, b1 = deserialize_uint32_t ok buf sz pos in (ok, pos, (U64.shift_left (u32_64 b0) 32ul) + u32_64 b1) end
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val deserialize_offset_t : ok: Prims.bool -> buf: MerkleTree.Low.Serialization.const_uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.ConstBuffer.length buf = FStar.UInt32.v sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST ((Prims.bool * MerkleTree.Low.Serialization.uint32_t) * MerkleTree.Low.Serialization.uint64_t)
[]
MerkleTree.Low.Serialization.deserialize_offset_t
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> buf: MerkleTree.Low.Serialization.const_uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.ConstBuffer.length buf = FStar.UInt32.v sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST ((Prims.bool * MerkleTree.Low.Serialization.uint32_t) * MerkleTree.Low.Serialization.uint64_t)
{ "end_col": 55, "end_line": 265, "start_col": 35, "start_line": 265 }
Prims.Tot
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let uint64_t = U64.t
let uint64_t =
false
null
false
U64.t
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[ "total" ]
[ "FStar.UInt64.t" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t
false
true
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val uint64_t : Prims.eqtype
[]
MerkleTree.Low.Serialization.uint64_t
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
Prims.eqtype
{ "end_col": 20, "end_line": 36, "start_col": 15, "start_line": 36 }
FStar.HyperStack.ST.ST
val hash_vv_bytes (#hash_size: hash_size_t) (vv: hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul
val hash_vv_bytes (#hash_size: hash_size_t) (vv: hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) let hash_vv_bytes (#hash_size: hash_size_t) (vv: hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) =
true
null
false
hash_vv_bytes_i vv 0ul
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Datastructures.hash_size_t", "MerkleTree.Low.Datastructures.hash_vv", "Prims.b2t", "Prims.op_Equality", "LowStar.Vector.uint32_t", "LowStar.Vector.size_of", "MerkleTree.Low.Datastructures.hash_vec", "MerkleTree.Low.merkle_tree_size_lg", "MerkleTree.Low.Serialization.hash_vv_bytes_i", "FStar.UInt32.__uint_to_t", "MerkleTree.Low.Serialization.uint64_t", "FStar.Monotonic.HyperStack.mem", "LowStar.Vector.live", "Prims.eq2" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val hash_vv_bytes (#hash_size: hash_size_t) (vv: hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1))
[]
MerkleTree.Low.Serialization.hash_vv_bytes
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
vv: MerkleTree.Low.Datastructures.hash_vv hash_size {LowStar.Vector.size_of vv = MerkleTree.Low.merkle_tree_size_lg} -> FStar.HyperStack.ST.ST MerkleTree.Low.Serialization.uint64_t
{ "end_col": 24, "end_line": 179, "start_col": 2, "start_line": 179 }
FStar.HyperStack.ST.ST
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let deserialize_index_t = deserialize_uint32_t
let deserialize_index_t =
true
null
false
deserialize_uint32_t
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Serialization.deserialize_uint32_t" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end private let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with| 0uy -> false | _ -> true)) private let deserialize_uint8_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0uy) else (true, pos + 1ul, CB.index buf pos) private let deserialize_uint16_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0us) else begin let ok, pos, b0 = deserialize_uint8_t ok buf sz pos in let ok, pos, b1 = deserialize_uint8_t ok buf sz pos in (ok, pos, (U16.shift_left (Int.Cast.uint8_to_uint16 b0) 8ul) + Int.Cast.uint8_to_uint16 b1) end private let deserialize_uint32_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0ul) else begin let ok, pos, b0 = deserialize_uint16_t ok buf sz pos in let ok, pos, b1 = deserialize_uint16_t ok buf sz pos in (ok, pos, (U32.shift_left (Int.Cast.uint16_to_uint32 b0) 16ul) + Int.Cast.uint16_to_uint32 b1) end private let deserialize_uint64_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0UL) else begin let ok, pos, b0 = deserialize_uint32_t ok buf sz pos in let ok, pos, b1 = deserialize_uint32_t ok buf sz pos in (ok, pos, (U64.shift_left (u32_64 b0) 32ul) + u32_64 b1) end
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val deserialize_index_t : ok: Prims.bool -> buf: MerkleTree.Low.Serialization.const_uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.ConstBuffer.length buf = FStar.UInt32.v sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST ((Prims.bool * MerkleTree.Low.Serialization.uint32_t) * MerkleTree.Low.Serialization.uint32_t)
[]
MerkleTree.Low.Serialization.deserialize_index_t
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> buf: MerkleTree.Low.Serialization.const_uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.ConstBuffer.length buf = FStar.UInt32.v sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST ((Prims.bool * MerkleTree.Low.Serialization.uint32_t) * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 54, "end_line": 266, "start_col": 34, "start_line": 266 }
FStar.HyperStack.ST.ST
val serialize_uint64_t (ok: bool) (x: uint64_t) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos
val serialize_uint64_t (ok: bool) (x: uint64_t) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) let serialize_uint64_t (ok: bool) (x: uint64_t) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) =
true
null
false
let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "Prims.bool", "MerkleTree.Low.Serialization.uint64_t", "MerkleTree.Low.Serialization.uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "FStar.UInt32.t", "LowStar.Monotonic.Buffer.len", "MerkleTree.Low.Serialization.uint8_t", "LowStar.Buffer.trivial_preorder", "MerkleTree.Low.Serialization.serialize_uint32_t", "FStar.Int.Cast.uint64_to_uint32", "FStar.Pervasives.Native.tuple2", "FStar.UInt64.shift_right", "FStar.UInt32.__uint_to_t", "FStar.Monotonic.HyperStack.mem", "LowStar.Monotonic.Buffer.live", "LowStar.Monotonic.Buffer.modifies", "LowStar.Monotonic.Buffer.loc_buffer" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val serialize_uint64_t (ok: bool) (x: uint64_t) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[]
MerkleTree.Low.Serialization.serialize_uint64_t
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> x: MerkleTree.Low.Serialization.uint64_t -> buf: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.Monotonic.Buffer.len buf = sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 64, "end_line": 78, "start_col": 1, "start_line": 77 }
FStar.HyperStack.ST.ST
val deserialize_bool (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with| 0uy -> false | _ -> true))
val deserialize_bool (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) let deserialize_bool (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) =
true
null
false
if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with | 0uy -> false | _ -> true))
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "Prims.bool", "MerkleTree.Low.Serialization.const_uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "Prims.int", "Prims.l_or", "Prims.op_GreaterThanOrEqual", "FStar.UInt.size", "FStar.UInt32.n", "LowStar.ConstBuffer.length", "MerkleTree.Low.Serialization.uint8_t", "FStar.UInt32.v", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Integers.Unsigned", "FStar.Integers.W32", "FStar.Pervasives.Native.Mktuple3", "FStar.Pervasives.Native.tuple3", "FStar.Integers.op_Plus", "FStar.UInt32.__uint_to_t", "FStar.UInt8.t", "LowStar.ConstBuffer.index", "FStar.Monotonic.HyperStack.mem", "LowStar.ConstBuffer.live", "Prims.eq2" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end private let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val deserialize_bool (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1))
[]
MerkleTree.Low.Serialization.deserialize_bool
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> buf: MerkleTree.Low.Serialization.const_uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.ConstBuffer.length buf = FStar.UInt32.v sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST ((Prims.bool * MerkleTree.Low.Serialization.uint32_t) * Prims.bool)
{ "end_col": 81, "end_line": 223, "start_col": 2, "start_line": 222 }
FStar.HyperStack.ST.ST
val hash_vv_bytes_i (#hash_size: hash_size_t) (vv: hash_vv hash_size) (i: uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end
val hash_vv_bytes_i (#hash_size: hash_size_t) (vv: hash_vv hash_size) (i: uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) let rec hash_vv_bytes_i (#hash_size: hash_size_t) (vv: hash_vv hash_size) (i: uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) =
true
null
false
if i >= V.size_of vv then 4uL else let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i + 1ul) in if u64_add_fits r rest then (assert (UInt.size (U64.v r + U64.v rest) 64); r + rest) else uint64_max
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Datastructures.hash_size_t", "MerkleTree.Low.Datastructures.hash_vv", "MerkleTree.Low.Serialization.uint32_t", "FStar.Integers.op_Greater_Equals", "FStar.Integers.Unsigned", "FStar.Integers.W32", "LowStar.Vector.size_of", "MerkleTree.Low.Datastructures.hash_vec", "FStar.UInt64.__uint_to_t", "MerkleTree.Low.Serialization.uint64_t", "Prims.bool", "MerkleTree.Low.Serialization.u64_add_fits", "FStar.Integers.op_Plus", "FStar.Integers.W64", "Prims.unit", "Prims._assert", "FStar.UInt.size", "FStar.Integers.Signed", "FStar.Integers.Winfinite", "FStar.UInt64.v", "MerkleTree.Low.uint64_max", "MerkleTree.Low.Serialization.hash_vv_bytes_i", "FStar.UInt32.__uint_to_t", "MerkleTree.Low.Serialization.hash_vec_bytes", "LowStar.Vector.index", "FStar.Monotonic.HyperStack.mem", "LowStar.Vector.live", "Prims.eq2" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val hash_vv_bytes_i (#hash_size: hash_size_t) (vv: hash_vv hash_size) (i: uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1))
[ "recursion" ]
MerkleTree.Low.Serialization.hash_vv_bytes_i
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
vv: MerkleTree.Low.Datastructures.hash_vv hash_size -> i: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST MerkleTree.Low.Serialization.uint64_t
{ "end_col": 5, "end_line": 170, "start_col": 2, "start_line": 160 }
FStar.HyperStack.ST.ST
val deserialize_uint32_t (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let deserialize_uint32_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0ul) else begin let ok, pos, b0 = deserialize_uint16_t ok buf sz pos in let ok, pos, b1 = deserialize_uint16_t ok buf sz pos in (ok, pos, (U32.shift_left (Int.Cast.uint16_to_uint32 b0) 16ul) + Int.Cast.uint16_to_uint32 b1) end
val deserialize_uint32_t (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) let deserialize_uint32_t (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) =
true
null
false
if not ok || pos >= sz then (false, pos, 0ul) else let ok, pos, b0 = deserialize_uint16_t ok buf sz pos in let ok, pos, b1 = deserialize_uint16_t ok buf sz pos in (ok, pos, (U32.shift_left (Int.Cast.uint16_to_uint32 b0) 16ul) + Int.Cast.uint16_to_uint32 b1)
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "Prims.bool", "MerkleTree.Low.Serialization.const_uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "Prims.int", "Prims.l_or", "Prims.op_GreaterThanOrEqual", "FStar.UInt.size", "FStar.UInt32.n", "LowStar.ConstBuffer.length", "MerkleTree.Low.Serialization.uint8_t", "FStar.UInt32.v", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Integers.Unsigned", "FStar.Integers.W32", "FStar.Pervasives.Native.Mktuple3", "FStar.UInt32.__uint_to_t", "FStar.Pervasives.Native.tuple3", "MerkleTree.Low.Serialization.uint16_t", "FStar.Integers.op_Plus", "FStar.UInt32.shift_left", "FStar.Int.Cast.uint16_to_uint32", "MerkleTree.Low.Serialization.deserialize_uint16_t", "FStar.Monotonic.HyperStack.mem", "LowStar.ConstBuffer.live", "Prims.eq2" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end private let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with| 0uy -> false | _ -> true)) private let deserialize_uint8_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0uy) else (true, pos + 1ul, CB.index buf pos) private let deserialize_uint16_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0us) else begin let ok, pos, b0 = deserialize_uint8_t ok buf sz pos in let ok, pos, b1 = deserialize_uint8_t ok buf sz pos in (ok, pos, (U16.shift_left (Int.Cast.uint8_to_uint16 b0) 8ul) + Int.Cast.uint8_to_uint16 b1) end private let deserialize_uint32_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val deserialize_uint32_t (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1))
[]
MerkleTree.Low.Serialization.deserialize_uint32_t
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> buf: MerkleTree.Low.Serialization.const_uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.ConstBuffer.length buf = FStar.UInt32.v sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST ((Prims.bool * MerkleTree.Low.Serialization.uint32_t) * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 5, "end_line": 252, "start_col": 2, "start_line": 247 }
Prims.Tot
val u64_add_fits (x y: uint64_t) : Tot (r: bool{r ==> UInt.size (U64.v x + U64.v y) 64})
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y
val u64_add_fits (x y: uint64_t) : Tot (r: bool{r ==> UInt.size (U64.v x + U64.v y) 64}) let u64_add_fits (x y: uint64_t) : Tot (r: bool{r ==> UInt.size (U64.v x + U64.v y) 64}) =
false
null
false
uint64_max - x >= y
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[ "total" ]
[ "MerkleTree.Low.Serialization.uint64_t", "FStar.Integers.op_Greater_Equals", "FStar.Integers.Unsigned", "FStar.Integers.W64", "FStar.Integers.op_Subtraction", "MerkleTree.Low.uint64_max", "Prims.bool", "Prims.l_imp", "Prims.b2t", "FStar.UInt.size", "FStar.Integers.op_Plus", "FStar.Integers.Signed", "FStar.Integers.Winfinite", "FStar.UInt64.v" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val u64_add_fits (x y: uint64_t) : Tot (r: bool{r ==> UInt.size (U64.v x + U64.v y) 64})
[]
MerkleTree.Low.Serialization.u64_add_fits
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
x: MerkleTree.Low.Serialization.uint64_t -> y: MerkleTree.Low.Serialization.uint64_t -> r: Prims.bool{r ==> FStar.UInt.size (FStar.UInt64.v x + FStar.UInt64.v y) 64}
{ "end_col": 118, "end_line": 107, "start_col": 99, "start_line": 107 }
FStar.HyperStack.ST.ST
val serialize_uint8_t (ok: bool) (x: uint8_t) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end
val serialize_uint8_t (ok: bool) (x: uint8_t) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) let serialize_uint8_t (ok: bool) (x: uint8_t) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) =
true
null
false
if not ok || pos >= sz then (false, 0ul) else (B.upd buf pos x; (true, pos + 1ul))
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "Prims.bool", "MerkleTree.Low.Serialization.uint8_t", "MerkleTree.Low.Serialization.uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "FStar.UInt32.t", "LowStar.Monotonic.Buffer.len", "LowStar.Buffer.trivial_preorder", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Integers.Unsigned", "FStar.Integers.W32", "FStar.Pervasives.Native.Mktuple2", "FStar.UInt32.__uint_to_t", "FStar.Pervasives.Native.tuple2", "FStar.Integers.op_Plus", "Prims.unit", "LowStar.Monotonic.Buffer.upd", "FStar.Monotonic.HyperStack.mem", "LowStar.Monotonic.Buffer.live", "LowStar.Monotonic.Buffer.modifies", "LowStar.Monotonic.Buffer.loc_buffer" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val serialize_uint8_t (ok: bool) (x: uint8_t) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[]
MerkleTree.Low.Serialization.serialize_uint8_t
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> x: MerkleTree.Low.Serialization.uint8_t -> buf: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.Monotonic.Buffer.len buf = sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 5, "end_line": 60, "start_col": 2, "start_line": 57 }
FStar.HyperStack.ST.ST
val serialize_uint16_t (ok: bool) (x: uint16_t) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos
val serialize_uint16_t (ok: bool) (x: uint16_t) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) let serialize_uint16_t (ok: bool) (x: uint16_t) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) =
true
null
false
let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "Prims.bool", "MerkleTree.Low.Serialization.uint16_t", "MerkleTree.Low.Serialization.uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "FStar.UInt32.t", "LowStar.Monotonic.Buffer.len", "MerkleTree.Low.Serialization.uint8_t", "LowStar.Buffer.trivial_preorder", "MerkleTree.Low.Serialization.serialize_uint8_t", "FStar.Int.Cast.uint16_to_uint8", "FStar.Pervasives.Native.tuple2", "FStar.UInt16.shift_right", "FStar.UInt32.__uint_to_t", "FStar.Monotonic.HyperStack.mem", "LowStar.Monotonic.Buffer.live", "LowStar.Monotonic.Buffer.modifies", "LowStar.Monotonic.Buffer.loc_buffer" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val serialize_uint16_t (ok: bool) (x: uint16_t) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[]
MerkleTree.Low.Serialization.serialize_uint16_t
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> x: MerkleTree.Low.Serialization.uint16_t -> buf: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.Monotonic.Buffer.len buf = sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 62, "end_line": 66, "start_col": 1, "start_line": 65 }
FStar.HyperStack.ST.ST
val deserialize_uint8_t (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let deserialize_uint8_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0uy) else (true, pos + 1ul, CB.index buf pos)
val deserialize_uint8_t (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) let deserialize_uint8_t (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) =
true
null
false
if not ok || pos >= sz then (false, pos, 0uy) else (true, pos + 1ul, CB.index buf pos)
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "Prims.bool", "MerkleTree.Low.Serialization.const_uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "Prims.int", "Prims.l_or", "Prims.op_GreaterThanOrEqual", "FStar.UInt.size", "FStar.UInt32.n", "LowStar.ConstBuffer.length", "MerkleTree.Low.Serialization.uint8_t", "FStar.UInt32.v", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Integers.Unsigned", "FStar.Integers.W32", "FStar.Pervasives.Native.Mktuple3", "FStar.UInt8.__uint_to_t", "FStar.Pervasives.Native.tuple3", "FStar.Integers.op_Plus", "FStar.UInt32.__uint_to_t", "LowStar.ConstBuffer.index", "FStar.Monotonic.HyperStack.mem", "LowStar.ConstBuffer.live", "Prims.eq2" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end private let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with| 0uy -> false | _ -> true)) private let deserialize_uint8_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val deserialize_uint8_t (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1))
[]
MerkleTree.Low.Serialization.deserialize_uint8_t
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> buf: MerkleTree.Low.Serialization.const_uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.ConstBuffer.length buf = FStar.UInt32.v sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST ((Prims.bool * MerkleTree.Low.Serialization.uint32_t) * MerkleTree.Low.Serialization.uint8_t)
{ "end_col": 42, "end_line": 230, "start_col": 2, "start_line": 229 }
FStar.HyperStack.ST.ST
val serialize_hash (#hash_size: hash_size_t) (ok: bool) (x: hash #hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul
val serialize_hash (#hash_size: hash_size_t) (ok: bool) (x: hash #hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) let serialize_hash (#hash_size: hash_size_t) (ok: bool) (x: hash #hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) =
true
null
false
if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Datastructures.hash_size_t", "Prims.bool", "MerkleTree.Low.Datastructures.hash", "MerkleTree.Low.Serialization.uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "FStar.UInt32.t", "LowStar.Monotonic.Buffer.len", "MerkleTree.Low.Serialization.uint8_t", "LowStar.Buffer.trivial_preorder", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Integers.Unsigned", "FStar.Integers.W32", "FStar.Pervasives.Native.Mktuple2", "FStar.UInt32.__uint_to_t", "FStar.Pervasives.Native.tuple2", "MerkleTree.Low.Serialization.serialize_hash_i", "FStar.Monotonic.HyperStack.mem", "Prims.l_and", "LowStar.Monotonic.Buffer.live", "Lib.IntTypes.uint8", "LowStar.Monotonic.Buffer.modifies", "LowStar.Monotonic.Buffer.loc_buffer" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val serialize_hash (#hash_size: hash_size_t) (ok: bool) (x: hash #hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[]
MerkleTree.Low.Serialization.serialize_hash
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> x: MerkleTree.Low.Datastructures.hash -> buf: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.Monotonic.Buffer.len buf = sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 43, "end_line": 104, "start_col": 2, "start_line": 103 }
FStar.HyperStack.ST.ST
val serialize_hash_vv (#hash_size: hash_size_t) (ok: bool) (x: hash_vv hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end
val serialize_hash_vv (#hash_size: hash_size_t) (ok: bool) (x: hash_vv hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) let serialize_hash_vv (#hash_size: hash_size_t) (ok: bool) (x: hash_vv hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) =
true
null
false
if not ok || pos >= sz then (false, 0ul) else let h0 = HST.get () in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get () in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos)
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Datastructures.hash_size_t", "Prims.bool", "MerkleTree.Low.Datastructures.hash_vv", "MerkleTree.Low.Serialization.uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "FStar.UInt32.t", "LowStar.Monotonic.Buffer.len", "MerkleTree.Low.Serialization.uint8_t", "LowStar.Buffer.trivial_preorder", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Integers.Unsigned", "FStar.Integers.W32", "FStar.Pervasives.Native.Mktuple2", "FStar.UInt32.__uint_to_t", "FStar.Pervasives.Native.tuple2", "FStar.Integers.op_Greater", "LowStar.Vector.size_of", "MerkleTree.Low.Datastructures.hash_vec", "MerkleTree.Low.Serialization.serialize_hash_vv_i", "Prims.unit", "LowStar.RVector.rv_inv_preserved", "MerkleTree.Low.Datastructures.hvreg", "LowStar.Monotonic.Buffer.loc_buffer", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "MerkleTree.Low.Serialization.serialize_uint32_t", "Prims.l_and", "LowStar.Monotonic.Buffer.live", "LowStar.RVector.rv_inv", "FStar.Monotonic.HyperHeap.disjoint", "LowStar.Monotonic.Buffer.frameOf", "LowStar.Regional.__proj__Rgl__item__region_of", "LowStar.Regional.regional", "MerkleTree.Low.Datastructures.hvvreg", "LowStar.Monotonic.Buffer.modifies" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x)))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val serialize_hash_vv (#hash_size: hash_size_t) (ok: bool) (x: hash_vv hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[]
MerkleTree.Low.Serialization.serialize_hash_vv
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> x: MerkleTree.Low.Datastructures.hash_vv hash_size -> buf: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.Monotonic.Buffer.len buf = sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 5, "end_line": 216, "start_col": 2, "start_line": 208 }
FStar.HyperStack.ST.ST
val serialize_bool (ok x: bool) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end
val serialize_bool (ok x: bool) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) let serialize_bool (ok x: bool) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) =
true
null
false
if not ok || pos >= sz then (false, 0ul) else (B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul))
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "Prims.bool", "MerkleTree.Low.Serialization.uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "FStar.UInt32.t", "LowStar.Monotonic.Buffer.len", "MerkleTree.Low.Serialization.uint8_t", "LowStar.Buffer.trivial_preorder", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Integers.Unsigned", "FStar.Integers.W32", "FStar.Pervasives.Native.Mktuple2", "FStar.UInt32.__uint_to_t", "FStar.Pervasives.Native.tuple2", "FStar.Integers.op_Plus", "Prims.unit", "LowStar.Monotonic.Buffer.upd", "FStar.UInt8.__uint_to_t", "FStar.Monotonic.HyperStack.mem", "LowStar.Monotonic.Buffer.live", "LowStar.Monotonic.Buffer.modifies", "LowStar.Monotonic.Buffer.loc_buffer" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val serialize_bool (ok x: bool) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[]
MerkleTree.Low.Serialization.serialize_bool
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> x: Prims.bool -> buf: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.Monotonic.Buffer.len buf = sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 5, "end_line": 52, "start_col": 2, "start_line": 48 }
FStar.HyperStack.ST.ST
val serialize_uint32_t (ok: bool) (x: uint32_t) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos
val serialize_uint32_t (ok: bool) (x: uint32_t) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) let serialize_uint32_t (ok: bool) (x: uint32_t) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) =
true
null
false
let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "Prims.bool", "MerkleTree.Low.Serialization.uint32_t", "MerkleTree.Low.Serialization.uint8_p", "Prims.b2t", "Prims.op_Equality", "FStar.UInt32.t", "LowStar.Monotonic.Buffer.len", "MerkleTree.Low.Serialization.uint8_t", "LowStar.Buffer.trivial_preorder", "MerkleTree.Low.Serialization.serialize_uint16_t", "FStar.Int.Cast.uint32_to_uint16", "FStar.Pervasives.Native.tuple2", "FStar.UInt32.shift_right", "FStar.UInt32.__uint_to_t", "FStar.Monotonic.HyperStack.mem", "LowStar.Monotonic.Buffer.live", "LowStar.Monotonic.Buffer.modifies", "LowStar.Monotonic.Buffer.loc_buffer" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val serialize_uint32_t (ok: bool) (x: uint32_t) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[]
MerkleTree.Low.Serialization.serialize_uint32_t
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> x: MerkleTree.Low.Serialization.uint32_t -> buf: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.Monotonic.Buffer.len buf = sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 64, "end_line": 72, "start_col": 1, "start_line": 71 }
FStar.HyperStack.ST.ST
val deserialize_uint64_t (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let deserialize_uint64_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0UL) else begin let ok, pos, b0 = deserialize_uint32_t ok buf sz pos in let ok, pos, b1 = deserialize_uint32_t ok buf sz pos in (ok, pos, (U64.shift_left (u32_64 b0) 32ul) + u32_64 b1) end
val deserialize_uint64_t (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) let deserialize_uint64_t (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) =
true
null
false
if not ok || pos >= sz then (false, pos, 0uL) else let ok, pos, b0 = deserialize_uint32_t ok buf sz pos in let ok, pos, b1 = deserialize_uint32_t ok buf sz pos in (ok, pos, (U64.shift_left (u32_64 b0) 32ul) + u32_64 b1)
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "Prims.bool", "MerkleTree.Low.Serialization.const_uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "Prims.int", "Prims.l_or", "Prims.op_GreaterThanOrEqual", "FStar.UInt.size", "FStar.UInt32.n", "LowStar.ConstBuffer.length", "MerkleTree.Low.Serialization.uint8_t", "FStar.UInt32.v", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Integers.Unsigned", "FStar.Integers.W32", "FStar.Pervasives.Native.Mktuple3", "MerkleTree.Low.Serialization.uint64_t", "FStar.UInt64.__uint_to_t", "FStar.Pervasives.Native.tuple3", "FStar.Integers.op_Plus", "FStar.Integers.W64", "FStar.UInt64.shift_left", "MerkleTree.Low.u32_64", "FStar.UInt32.__uint_to_t", "MerkleTree.Low.Serialization.deserialize_uint32_t", "FStar.Monotonic.HyperStack.mem", "LowStar.ConstBuffer.live", "Prims.eq2" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end private let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with| 0uy -> false | _ -> true)) private let deserialize_uint8_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0uy) else (true, pos + 1ul, CB.index buf pos) private let deserialize_uint16_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0us) else begin let ok, pos, b0 = deserialize_uint8_t ok buf sz pos in let ok, pos, b1 = deserialize_uint8_t ok buf sz pos in (ok, pos, (U16.shift_left (Int.Cast.uint8_to_uint16 b0) 8ul) + Int.Cast.uint8_to_uint16 b1) end private let deserialize_uint32_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0ul) else begin let ok, pos, b0 = deserialize_uint16_t ok buf sz pos in let ok, pos, b1 = deserialize_uint16_t ok buf sz pos in (ok, pos, (U32.shift_left (Int.Cast.uint16_to_uint32 b0) 16ul) + Int.Cast.uint16_to_uint32 b1) end private let deserialize_uint64_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val deserialize_uint64_t (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1))
[]
MerkleTree.Low.Serialization.deserialize_uint64_t
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> buf: MerkleTree.Low.Serialization.const_uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.ConstBuffer.length buf = FStar.UInt32.v sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST ((Prims.bool * MerkleTree.Low.Serialization.uint32_t) * MerkleTree.Low.Serialization.uint64_t)
{ "end_col": 5, "end_line": 263, "start_col": 2, "start_line": 258 }
FStar.HyperStack.ST.ST
val serialize_hash_i (#hash_size: hash_size_t) (ok: bool) (x: hash #hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) (i: uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos)
val serialize_hash_i (#hash_size: hash_size_t) (ok: bool) (x: hash #hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) (i: uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) let rec serialize_hash_i (#hash_size: hash_size_t) (ok: bool) (x: hash #hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) (i: uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) =
true
null
false
if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos)
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Datastructures.hash_size_t", "Prims.bool", "MerkleTree.Low.Datastructures.hash", "MerkleTree.Low.Serialization.uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "FStar.UInt32.t", "LowStar.Monotonic.Buffer.len", "MerkleTree.Low.Serialization.uint8_t", "LowStar.Buffer.trivial_preorder", "FStar.Integers.op_Less", "FStar.Integers.Unsigned", "FStar.Integers.W32", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Pervasives.Native.Mktuple2", "FStar.UInt32.__uint_to_t", "FStar.Pervasives.Native.tuple2", "MerkleTree.Low.Serialization.serialize_hash_i", "FStar.Integers.int_t", "FStar.Integers.op_Plus", "MerkleTree.Low.Serialization.serialize_uint8_t", "Lib.RawIntTypes.u8_to_UInt8", "Lib.IntTypes.int_t", "Lib.IntTypes.U8", "Lib.IntTypes.SEC", "LowStar.BufferOps.op_Array_Access", "Lib.IntTypes.uint8", "FStar.Monotonic.HyperStack.mem", "Prims.l_and", "LowStar.Monotonic.Buffer.live", "LowStar.Monotonic.Buffer.modifies", "LowStar.Monotonic.Buffer.loc_buffer" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val serialize_hash_i (#hash_size: hash_size_t) (ok: bool) (x: hash #hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) (i: uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[ "recursion" ]
MerkleTree.Low.Serialization.serialize_hash_i
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> x: MerkleTree.Low.Datastructures.hash -> buf: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.Monotonic.Buffer.len buf = sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> i: MerkleTree.Low.Serialization.uint32_t{i < hash_size} -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 21, "end_line": 94, "start_col": 2, "start_line": 89 }
FStar.HyperStack.ST.ST
val mt_serialize_path: #hsz:Ghost.erased hash_size_t -> p:const_path_p -> output:uint8_p -> sz:uint64_t -> HST.ST uint64_t (requires (fun h0 -> let ncp = CB.cast p in let phv = B.get h0 ncp 0 in Path?.hash_size phv = Ghost.reveal hsz /\ path_safe h0 (B.frameOf (CB.cast p)) ncp /\ RV.rv_inv #(hash #hsz) #hash_size_t #(hreg hsz) h0 (Path?.hashes phv) /\ B.live h0 output /\ B.length output = U64.v sz /\ HS.disjoint (B.frameOf output) (B.frameOf ncp))) (ensures (fun h0 _ h1 -> path_safe h1 (B.frameOf (CB.cast p)) (CB.cast p) /\ modifies (B.loc_buffer output) h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let mt_serialize_path #hsz p output sz = let hsz = Path?.hash_size !*(CB.cast p) in let sz = FStar.Int.Cast.uint64_to_uint32 sz in let ncp = CB.cast p in let h0 = HST.get() in let ok, pos = serialize_uint32_t true hsz output sz 0ul in let h1 = HST.get() in let ncpd = !*ncp in let ok, pos = serialize_hash_vec #hsz ok (Path?.hashes ncpd) output sz pos in if ok then (FStar.Int.Cast.uint32_to_uint64 pos) else 0UL
val mt_serialize_path: #hsz:Ghost.erased hash_size_t -> p:const_path_p -> output:uint8_p -> sz:uint64_t -> HST.ST uint64_t (requires (fun h0 -> let ncp = CB.cast p in let phv = B.get h0 ncp 0 in Path?.hash_size phv = Ghost.reveal hsz /\ path_safe h0 (B.frameOf (CB.cast p)) ncp /\ RV.rv_inv #(hash #hsz) #hash_size_t #(hreg hsz) h0 (Path?.hashes phv) /\ B.live h0 output /\ B.length output = U64.v sz /\ HS.disjoint (B.frameOf output) (B.frameOf ncp))) (ensures (fun h0 _ h1 -> path_safe h1 (B.frameOf (CB.cast p)) (CB.cast p) /\ modifies (B.loc_buffer output) h0 h1)) let mt_serialize_path #hsz p output sz =
true
null
false
let hsz = Path?.hash_size !*(CB.cast p) in let sz = FStar.Int.Cast.uint64_to_uint32 sz in let ncp = CB.cast p in let h0 = HST.get () in let ok, pos = serialize_uint32_t true hsz output sz 0ul in let h1 = HST.get () in let ncpd = !*ncp in let ok, pos = serialize_hash_vec #hsz ok (Path?.hashes ncpd) output sz pos in if ok then (FStar.Int.Cast.uint32_to_uint64 pos) else 0uL
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "FStar.Ghost.erased", "MerkleTree.Low.Datastructures.hash_size_t", "MerkleTree.Low.const_path_p", "MerkleTree.Low.Serialization.uint8_p", "MerkleTree.Low.Serialization.uint64_t", "Prims.bool", "MerkleTree.Low.Serialization.uint32_t", "FStar.Int.Cast.uint32_to_uint64", "FStar.UInt64.__uint_to_t", "FStar.Pervasives.Native.tuple2", "MerkleTree.Low.Serialization.serialize_hash_vec", "MerkleTree.Low.__proj__Path__item__hashes", "MerkleTree.Low.path", "LowStar.BufferOps.op_Bang_Star", "LowStar.ConstBuffer.qbuf_pre", "LowStar.ConstBuffer.as_qbuf", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "MerkleTree.Low.Serialization.serialize_uint32_t", "FStar.UInt32.__uint_to_t", "LowStar.Monotonic.Buffer.mbuffer", "LowStar.ConstBuffer.cast", "FStar.UInt32.t", "Prims.b2t", "Prims.op_Equality", "Prims.int", "FStar.UInt32.v", "Prims.op_Modulus", "FStar.UInt64.v", "Prims.pow2", "FStar.Int.Cast.uint64_to_uint32", "MerkleTree.Low.__proj__Path__item__hash_size" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end private let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with| 0uy -> false | _ -> true)) private let deserialize_uint8_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0uy) else (true, pos + 1ul, CB.index buf pos) private let deserialize_uint16_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0us) else begin let ok, pos, b0 = deserialize_uint8_t ok buf sz pos in let ok, pos, b1 = deserialize_uint8_t ok buf sz pos in (ok, pos, (U16.shift_left (Int.Cast.uint8_to_uint16 b0) 8ul) + Int.Cast.uint8_to_uint16 b1) end private let deserialize_uint32_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0ul) else begin let ok, pos, b0 = deserialize_uint16_t ok buf sz pos in let ok, pos, b1 = deserialize_uint16_t ok buf sz pos in (ok, pos, (U32.shift_left (Int.Cast.uint16_to_uint32 b0) 16ul) + Int.Cast.uint16_to_uint32 b1) end private let deserialize_uint64_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0UL) else begin let ok, pos, b0 = deserialize_uint32_t ok buf sz pos in let ok, pos, b1 = deserialize_uint32_t ok buf sz pos in (ok, pos, (U64.shift_left (u32_64 b0) 32ul) + u32_64 b1) end private let deserialize_offset_t = deserialize_uint64_t private let deserialize_index_t = deserialize_uint32_t private let deserialize_hash (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 (k, _, h) h1 -> (k ==> Rgl?.r_inv (hreg hash_size) h1 h) /\ loc_disjoint (loc_buffer (CB.cast buf)) (loc_buffer h) /\ modifies B.loc_none h0 h1)) = let rg = hreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else if sz - pos < hash_size then (false, pos, rg_dummy rg) else begin let hash = rg_alloc rg r in Lib.RawBuffer.blit (CB.cast buf) pos hash 0ul hash_size; (true, pos + hash_size, hash) end private let rec deserialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) (res:hash_vec #hash_size) (i:uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res)) (ensures (fun h0 _ h1 -> B.modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) = if not ok || pos >= sz then (false, pos) else begin let ok, pos, h = deserialize_hash ok buf sz r pos in if not ok then (false, pos) else begin V.assign res i h; (* * AR: 04/01: The call deserialize_hash_vec_i below needs liveness of buf * So we have to frame buf liveness for the V.assign call * V.assign provides a modifies postcondition in terms of * loc_vector_within, which is a recursive predicate and * I guess hard to reason about directly * Whereas to reason about liveness of buf, we only need an * overapproximation that V.assign modifies V.Vec?.vs res * Looking at the Vector library, I found the following lemma * that does the trick *) V.loc_vector_within_included res i (i + 1ul); let j = i + 1ul in if j < V.size_of res then deserialize_hash_vec_i ok buf sz r pos res j else (true, pos) end end private let deserialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash_vec #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> B.modifies B.loc_none h0 h1)) = let rg = hvreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else begin let ok, pos, n = deserialize_uint32_t ok buf sz pos in if not ok then (false, pos, V.alloc_empty hash) else if n = 0ul then (true, pos, V.alloc_empty hash) else begin let hrg = hreg hash_size in let res = V.alloc n (rg_dummy hrg) in let ok, pos = deserialize_hash_vec_i ok buf sz r pos res 0ul in (ok, pos, res) end end private let rec deserialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) (res:hash_vv hash_size) (i:uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res /\ B.loc_disjoint (CB.loc_buffer buf) (V.loc_vector res))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let ok, pos, hv = deserialize_hash_vec ok buf sz r pos in let h0 = HST.get() in if not ok then (false, pos) else begin V.assign res i hv; (* * AR: 04/01: The call deserialize_hash_vv_i below needs liveness of buf * So we have to frame buf liveness for the V.assign call * V.assign provides a modifies postcondition in terms of * loc_vector_within, which is a recursive predicate and * I guess hard to reason about directly * Whereas to reason about liveness of buf, we only need an * overapproximation that V.assign modifies V.Vec?.vs res * Looking at the Vector library, I found the following lemma * that does the trick *) V.loc_vector_within_included res i (i + 1ul); let j = i + 1ul in if j = V.size_of res then (true, pos) else deserialize_hash_vv_i ok buf sz r pos res j end end private let deserialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash_vv hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> modifies B.loc_none h0 h1)) = if not ok || pos >= sz then (false, pos, V.alloc_empty hash_vec) else begin let ok, pos, n = deserialize_uint32_t ok buf sz pos in if not ok then (false, pos, V.alloc_empty hash_vec) else if n = 0ul then (true, pos, V.alloc_empty hash_vec) else begin let rg = hvreg hash_size in let res = V.alloc n (rg_dummy rg) in let ok, pos = deserialize_hash_vv_i ok buf sz r pos res 0ul in (ok, pos, res) end end #push-options "--z3rlimit 10" val mt_serialize_size: mt:const_mt_p -> HST.ST uint64_t (requires (fun h0 -> mt_safe h0 (CB.cast mt))) (ensures (fun _ _ h1 -> mt_safe h1 (CB.cast mt))) let mt_serialize_size mt = let mtv = !*(CB.cast mt) in let hs = MT?.hs mtv in let rhs_ok = MT?.rhs_ok mtv in let rhs = MT?.rhs mtv in let hs_sz = hash_vv_bytes hs in if hs_sz < uint32_max then 1UL + // format version 4UL + // hash_size 8UL + // offset 4UL + 4UL + // i, j hs_sz + // hs 1UL + // rhs_ok hash_vec_bytes rhs + // rhs u32_64 (MT?.hash_size mtv) // mroot else uint64_max #pop-options #push-options "--z3rlimit 15 --initial_fuel 1 --max_fuel 1" val mt_serialize: mt:const_mt_p -> output:uint8_p -> sz:uint64_t -> HST.ST uint64_t (requires (fun h0 -> mt_safe h0 (CB.cast mt) /\ B.live h0 output /\ B.length output = U64.v sz /\ HS.disjoint (B.frameOf output) (B.frameOf (CB.cast mt)))) (ensures (fun h0 _ h1 -> mt_safe h1 (CB.cast mt) /\ modifies (B.loc_buffer output) h0 h1)) let mt_serialize mt output sz = let mt = CB.cast mt in let sz = FStar.Int.Cast.uint64_to_uint32 sz in let mtv = !*mt in let h0 = HST.get() in let ok, pos = serialize_uint8_t true 1uy output sz 0ul in // format version = 1uy let h1 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h0 h1; let ok, pos = serialize_uint32_t ok (MT?.hash_size mtv) output sz pos in let h2 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h1 h2; let ok, pos = serialize_offset_t ok (MT?.offset mtv) output sz pos in let h3 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h2 h3; let ok, pos = serialize_uint32_t ok (MT?.i mtv) output sz pos in let h4 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h3 h4; let ok, pos = serialize_uint32_t ok (MT?.j mtv) output sz pos in let h5 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h4 h5; let ok, pos = serialize_hash_vv ok (MT?.hs mtv) output sz pos in let h6 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h5 h6; let ok, pos = serialize_bool ok (MT?.rhs_ok mtv) output sz pos in let h7 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h6 h7; let ok, pos = serialize_hash_vec ok (MT?.rhs mtv) output sz pos in let h8 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h7 h8; let ok, pos = serialize_hash ok (MT?.mroot mtv) output sz pos in let h9 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h8 h9; if ok then (FStar.Int.Cast.uint32_to_uint64 pos) else 0UL #pop-options #push-options "--z3rlimit 15 --initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" val mt_deserialize: #hsz:Ghost.erased hash_size_t -> rid:HST.erid -> input:const_uint8_p -> sz:uint64_t{CB.length input = U64.v sz} -> hash_spec:Ghost.erased(MTS.hash_fun_t #(U32.v (Ghost.reveal hsz))) -> hash_fun:hash_fun_t #(Ghost.reveal hsz) #hash_spec -> HST.ST (B.pointer_or_null merkle_tree) (requires (fun h0 -> CB.live h0 input /\ HS.disjoint rid (B.frameOf (CB.cast input)))) (ensures (fun h0 r h1 -> modifies B.loc_none h0 h1 /\ (not (g_is_null r)) ==> MT?.hash_size (B.get h1 r 0) = Ghost.reveal hsz)) let mt_deserialize #ghsz rid input sz hash_spec hash_fun = let sz = FStar.Int.Cast.uint64_to_uint32 sz in let hrid = HST.new_region rid in let hvrid = HST.new_region rid in let hvvrid = HST.new_region rid in let ok, pos, format_version = deserialize_uint8_t true input sz 0ul in let ok = ok && format_version = 1uy in let ok, pos, hsz = deserialize_uint32_t ok input sz pos in if hsz = 0ul then B.null #merkle_tree else begin let ok, pos, offset = deserialize_offset_t ok input sz pos in let ok, pos, i = deserialize_index_t ok input sz pos in let ok, pos, j = deserialize_index_t ok input sz pos in let ok, pos, hs = deserialize_hash_vv #hsz ok input sz hvvrid pos in let ok, pos, rhs_ok = deserialize_bool ok input sz pos in let ok, pos, rhs = deserialize_hash_vec #hsz ok input sz hvrid pos in let ok, pos, mroot = deserialize_hash #hsz ok input sz hrid pos in begin if not ok || not (merkle_tree_conditions #hsz offset i j hs rhs_ok rhs mroot) then B.null #merkle_tree else begin assume (hsz = Ghost.reveal ghsz); // We trust the user to provide a suitable hash_fun. B.malloc rid (MT hsz offset i j hs rhs_ok rhs mroot hash_spec hash_fun) 1ul end end end val mt_serialize_path: #hsz:Ghost.erased hash_size_t -> p:const_path_p -> output:uint8_p -> sz:uint64_t -> HST.ST uint64_t (requires (fun h0 -> let ncp = CB.cast p in let phv = B.get h0 ncp 0 in Path?.hash_size phv = Ghost.reveal hsz /\ path_safe h0 (B.frameOf (CB.cast p)) ncp /\ RV.rv_inv #(hash #hsz) #hash_size_t #(hreg hsz) h0 (Path?.hashes phv) /\ B.live h0 output /\ B.length output = U64.v sz /\ HS.disjoint (B.frameOf output) (B.frameOf ncp))) (ensures (fun h0 _ h1 -> path_safe h1 (B.frameOf (CB.cast p)) (CB.cast p) /\
false
false
MerkleTree.Low.Serialization.fst
{ "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": 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": 15, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val mt_serialize_path: #hsz:Ghost.erased hash_size_t -> p:const_path_p -> output:uint8_p -> sz:uint64_t -> HST.ST uint64_t (requires (fun h0 -> let ncp = CB.cast p in let phv = B.get h0 ncp 0 in Path?.hash_size phv = Ghost.reveal hsz /\ path_safe h0 (B.frameOf (CB.cast p)) ncp /\ RV.rv_inv #(hash #hsz) #hash_size_t #(hreg hsz) h0 (Path?.hashes phv) /\ B.live h0 output /\ B.length output = U64.v sz /\ HS.disjoint (B.frameOf output) (B.frameOf ncp))) (ensures (fun h0 _ h1 -> path_safe h1 (B.frameOf (CB.cast p)) (CB.cast p) /\ modifies (B.loc_buffer output) h0 h1))
[]
MerkleTree.Low.Serialization.mt_serialize_path
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
p: MerkleTree.Low.const_path_p -> output: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint64_t -> FStar.HyperStack.ST.ST MerkleTree.Low.Serialization.uint64_t
{ "end_col": 59, "end_line": 503, "start_col": 40, "start_line": 494 }
FStar.HyperStack.ST.ST
val deserialize_uint16_t (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let deserialize_uint16_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0us) else begin let ok, pos, b0 = deserialize_uint8_t ok buf sz pos in let ok, pos, b1 = deserialize_uint8_t ok buf sz pos in (ok, pos, (U16.shift_left (Int.Cast.uint8_to_uint16 b0) 8ul) + Int.Cast.uint8_to_uint16 b1) end
val deserialize_uint16_t (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) let deserialize_uint16_t (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) =
true
null
false
if not ok || pos >= sz then (false, pos, 0us) else let ok, pos, b0 = deserialize_uint8_t ok buf sz pos in let ok, pos, b1 = deserialize_uint8_t ok buf sz pos in (ok, pos, (U16.shift_left (Int.Cast.uint8_to_uint16 b0) 8ul) + Int.Cast.uint8_to_uint16 b1)
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "Prims.bool", "MerkleTree.Low.Serialization.const_uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "Prims.int", "Prims.l_or", "Prims.op_GreaterThanOrEqual", "FStar.UInt.size", "FStar.UInt32.n", "LowStar.ConstBuffer.length", "MerkleTree.Low.Serialization.uint8_t", "FStar.UInt32.v", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Integers.Unsigned", "FStar.Integers.W32", "FStar.Pervasives.Native.Mktuple3", "MerkleTree.Low.Serialization.uint16_t", "FStar.UInt16.__uint_to_t", "FStar.Pervasives.Native.tuple3", "FStar.Integers.op_Plus", "FStar.Integers.W16", "FStar.UInt16.shift_left", "FStar.Int.Cast.uint8_to_uint16", "FStar.UInt32.__uint_to_t", "MerkleTree.Low.Serialization.deserialize_uint8_t", "FStar.Monotonic.HyperStack.mem", "LowStar.ConstBuffer.live", "Prims.eq2" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end private let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with| 0uy -> false | _ -> true)) private let deserialize_uint8_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0uy) else (true, pos + 1ul, CB.index buf pos) private let deserialize_uint16_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val deserialize_uint16_t (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (pos: uint32_t) : HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1))
[]
MerkleTree.Low.Serialization.deserialize_uint16_t
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> buf: MerkleTree.Low.Serialization.const_uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.ConstBuffer.length buf = FStar.UInt32.v sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST ((Prims.bool * MerkleTree.Low.Serialization.uint32_t) * MerkleTree.Low.Serialization.uint16_t)
{ "end_col": 5, "end_line": 241, "start_col": 2, "start_line": 236 }
FStar.HyperStack.ST.ST
val deserialize_hash_vec_i (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) (res: hash_vec #hash_size) (i: uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res)) (ensures (fun h0 _ h1 -> B.modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rec deserialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) (res:hash_vec #hash_size) (i:uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res)) (ensures (fun h0 _ h1 -> B.modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) = if not ok || pos >= sz then (false, pos) else begin let ok, pos, h = deserialize_hash ok buf sz r pos in if not ok then (false, pos) else begin V.assign res i h; (* * AR: 04/01: The call deserialize_hash_vec_i below needs liveness of buf * So we have to frame buf liveness for the V.assign call * V.assign provides a modifies postcondition in terms of * loc_vector_within, which is a recursive predicate and * I guess hard to reason about directly * Whereas to reason about liveness of buf, we only need an * overapproximation that V.assign modifies V.Vec?.vs res * Looking at the Vector library, I found the following lemma * that does the trick *) V.loc_vector_within_included res i (i + 1ul); let j = i + 1ul in if j < V.size_of res then deserialize_hash_vec_i ok buf sz r pos res j else (true, pos) end end
val deserialize_hash_vec_i (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) (res: hash_vec #hash_size) (i: uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res)) (ensures (fun h0 _ h1 -> B.modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) let rec deserialize_hash_vec_i (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) (res: hash_vec #hash_size) (i: uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res)) (ensures (fun h0 _ h1 -> B.modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) =
true
null
false
if not ok || pos >= sz then (false, pos) else let ok, pos, h = deserialize_hash ok buf sz r pos in if not ok then (false, pos) else (V.assign res i h; V.loc_vector_within_included res i (i + 1ul); let j = i + 1ul in if j < V.size_of res then deserialize_hash_vec_i ok buf sz r pos res j else (true, pos))
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Datastructures.hash_size_t", "Prims.bool", "MerkleTree.Low.Serialization.const_uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "Prims.int", "Prims.l_or", "Prims.op_GreaterThanOrEqual", "FStar.UInt.size", "FStar.UInt32.n", "LowStar.ConstBuffer.length", "MerkleTree.Low.Serialization.uint8_t", "FStar.UInt32.v", "FStar.HyperStack.ST.erid", "MerkleTree.Low.Datastructures.hash_vec", "FStar.Integers.op_Less", "FStar.Integers.Unsigned", "FStar.Integers.W32", "LowStar.Vector.size_of", "MerkleTree.Low.Datastructures.hash", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Pervasives.Native.Mktuple2", "FStar.Pervasives.Native.tuple2", "MerkleTree.Low.Serialization.deserialize_hash_vec_i", "FStar.Integers.int_t", "FStar.Integers.op_Plus", "FStar.UInt32.__uint_to_t", "Prims.unit", "LowStar.Vector.loc_vector_within_included", "LowStar.Vector.assign", "FStar.Pervasives.Native.tuple3", "MerkleTree.Low.Serialization.deserialize_hash", "FStar.Monotonic.HyperStack.mem", "Prims.l_and", "LowStar.ConstBuffer.live", "LowStar.Vector.live", "LowStar.Monotonic.Buffer.modifies", "LowStar.Monotonic.Buffer.loc_buffer", "LowStar.Buffer.trivial_preorder", "LowStar.Vector.__proj__Vec__item__vs" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end private let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with| 0uy -> false | _ -> true)) private let deserialize_uint8_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0uy) else (true, pos + 1ul, CB.index buf pos) private let deserialize_uint16_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0us) else begin let ok, pos, b0 = deserialize_uint8_t ok buf sz pos in let ok, pos, b1 = deserialize_uint8_t ok buf sz pos in (ok, pos, (U16.shift_left (Int.Cast.uint8_to_uint16 b0) 8ul) + Int.Cast.uint8_to_uint16 b1) end private let deserialize_uint32_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0ul) else begin let ok, pos, b0 = deserialize_uint16_t ok buf sz pos in let ok, pos, b1 = deserialize_uint16_t ok buf sz pos in (ok, pos, (U32.shift_left (Int.Cast.uint16_to_uint32 b0) 16ul) + Int.Cast.uint16_to_uint32 b1) end private let deserialize_uint64_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0UL) else begin let ok, pos, b0 = deserialize_uint32_t ok buf sz pos in let ok, pos, b1 = deserialize_uint32_t ok buf sz pos in (ok, pos, (U64.shift_left (u32_64 b0) 32ul) + u32_64 b1) end private let deserialize_offset_t = deserialize_uint64_t private let deserialize_index_t = deserialize_uint32_t private let deserialize_hash (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 (k, _, h) h1 -> (k ==> Rgl?.r_inv (hreg hash_size) h1 h) /\ loc_disjoint (loc_buffer (CB.cast buf)) (loc_buffer h) /\ modifies B.loc_none h0 h1)) = let rg = hreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else if sz - pos < hash_size then (false, pos, rg_dummy rg) else begin let hash = rg_alloc rg r in Lib.RawBuffer.blit (CB.cast buf) pos hash 0ul hash_size; (true, pos + hash_size, hash) end private let rec deserialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) (res:hash_vec #hash_size) (i:uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val deserialize_hash_vec_i (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) (res: hash_vec #hash_size) (i: uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res)) (ensures (fun h0 _ h1 -> B.modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1))
[ "recursion" ]
MerkleTree.Low.Serialization.deserialize_hash_vec_i
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> buf: MerkleTree.Low.Serialization.const_uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.ConstBuffer.length buf = FStar.UInt32.v sz} -> r: FStar.HyperStack.ST.erid -> pos: MerkleTree.Low.Serialization.uint32_t -> res: MerkleTree.Low.Datastructures.hash_vec -> i: MerkleTree.Low.Serialization.uint32_t{i < LowStar.Vector.size_of res} -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 5, "end_line": 315, "start_col": 2, "start_line": 293 }
FStar.HyperStack.ST.ST
val serialize_hash_vec (#hash_size: hash_size_t) (ok: bool) (x: hash_vec #hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end
val serialize_hash_vec (#hash_size: hash_size_t) (ok: bool) (x: hash_vec #hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) let serialize_hash_vec (#hash_size: hash_size_t) (ok: bool) (x: hash_vec #hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) =
true
null
false
if not ok || pos >= sz then (false, 0ul) else let h0 = HST.get () in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get () in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos)
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Datastructures.hash_size_t", "Prims.bool", "MerkleTree.Low.Datastructures.hash_vec", "MerkleTree.Low.Serialization.uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "FStar.UInt32.t", "LowStar.Monotonic.Buffer.len", "MerkleTree.Low.Serialization.uint8_t", "LowStar.Buffer.trivial_preorder", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Integers.Unsigned", "FStar.Integers.W32", "FStar.Pervasives.Native.Mktuple2", "FStar.UInt32.__uint_to_t", "FStar.Pervasives.Native.tuple2", "Prims.op_AmpAmp", "FStar.Integers.op_Greater", "LowStar.Vector.size_of", "MerkleTree.Low.Datastructures.hash", "MerkleTree.Low.Serialization.serialize_hash_vec_i", "Prims.unit", "LowStar.RVector.rv_inv_preserved", "MerkleTree.Low.Datastructures.hreg", "LowStar.Monotonic.Buffer.loc_buffer", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "MerkleTree.Low.Serialization.serialize_uint32_t", "Prims.l_and", "LowStar.Monotonic.Buffer.live", "LowStar.RVector.rv_inv", "FStar.Monotonic.HyperHeap.disjoint", "LowStar.Monotonic.Buffer.frameOf", "LowStar.Regional.__proj__Rgl__item__region_of", "MerkleTree.Low.Datastructures.hvreg", "LowStar.Monotonic.Buffer.modifies" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x)))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val serialize_hash_vec (#hash_size: hash_size_t) (ok: bool) (x: hash_vec #hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1))
[]
MerkleTree.Low.Serialization.serialize_hash_vec
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> x: MerkleTree.Low.Datastructures.hash_vec -> buf: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.Monotonic.Buffer.len buf = sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 5, "end_line": 150, "start_col": 2, "start_line": 142 }
FStar.HyperStack.ST.ST
val deserialize_hash_vec (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) : HST.ST (bool & uint32_t & hash_vec #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> B.modifies B.loc_none h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let deserialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash_vec #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> B.modifies B.loc_none h0 h1)) = let rg = hvreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else begin let ok, pos, n = deserialize_uint32_t ok buf sz pos in if not ok then (false, pos, V.alloc_empty hash) else if n = 0ul then (true, pos, V.alloc_empty hash) else begin let hrg = hreg hash_size in let res = V.alloc n (rg_dummy hrg) in let ok, pos = deserialize_hash_vec_i ok buf sz r pos res 0ul in (ok, pos, res) end end
val deserialize_hash_vec (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) : HST.ST (bool & uint32_t & hash_vec #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> B.modifies B.loc_none h0 h1)) let deserialize_hash_vec (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) : HST.ST (bool & uint32_t & hash_vec #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> B.modifies B.loc_none h0 h1)) =
true
null
false
let rg = hvreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else let ok, pos, n = deserialize_uint32_t ok buf sz pos in if not ok then (false, pos, V.alloc_empty hash) else if n = 0ul then (true, pos, V.alloc_empty hash) else let hrg = hreg hash_size in let res = V.alloc n (rg_dummy hrg) in let ok, pos = deserialize_hash_vec_i ok buf sz r pos res 0ul in (ok, pos, res)
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Datastructures.hash_size_t", "Prims.bool", "MerkleTree.Low.Serialization.const_uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "Prims.int", "Prims.l_or", "Prims.op_GreaterThanOrEqual", "FStar.UInt.size", "FStar.UInt32.n", "LowStar.ConstBuffer.length", "MerkleTree.Low.Serialization.uint8_t", "FStar.UInt32.v", "FStar.HyperStack.ST.erid", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Integers.Unsigned", "FStar.Integers.W32", "FStar.Pervasives.Native.Mktuple3", "MerkleTree.Low.Datastructures.hash_vec", "LowStar.Regional.rg_dummy", "FStar.Pervasives.Native.tuple3", "LowStar.Vector.alloc_empty", "MerkleTree.Low.Datastructures.hash", "FStar.UInt32.t", "FStar.UInt32.__uint_to_t", "FStar.Pervasives.Native.tuple2", "MerkleTree.Low.Serialization.deserialize_hash_vec_i", "LowStar.Vector.vector", "LowStar.Vector.alloc", "LowStar.Regional.regional", "MerkleTree.Low.Datastructures.hreg", "MerkleTree.Low.Serialization.deserialize_uint32_t", "MerkleTree.Low.Datastructures.hvreg", "FStar.Monotonic.HyperStack.mem", "LowStar.ConstBuffer.live", "LowStar.Monotonic.Buffer.modifies", "LowStar.Monotonic.Buffer.loc_none" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end private let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with| 0uy -> false | _ -> true)) private let deserialize_uint8_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0uy) else (true, pos + 1ul, CB.index buf pos) private let deserialize_uint16_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0us) else begin let ok, pos, b0 = deserialize_uint8_t ok buf sz pos in let ok, pos, b1 = deserialize_uint8_t ok buf sz pos in (ok, pos, (U16.shift_left (Int.Cast.uint8_to_uint16 b0) 8ul) + Int.Cast.uint8_to_uint16 b1) end private let deserialize_uint32_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0ul) else begin let ok, pos, b0 = deserialize_uint16_t ok buf sz pos in let ok, pos, b1 = deserialize_uint16_t ok buf sz pos in (ok, pos, (U32.shift_left (Int.Cast.uint16_to_uint32 b0) 16ul) + Int.Cast.uint16_to_uint32 b1) end private let deserialize_uint64_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0UL) else begin let ok, pos, b0 = deserialize_uint32_t ok buf sz pos in let ok, pos, b1 = deserialize_uint32_t ok buf sz pos in (ok, pos, (U64.shift_left (u32_64 b0) 32ul) + u32_64 b1) end private let deserialize_offset_t = deserialize_uint64_t private let deserialize_index_t = deserialize_uint32_t private let deserialize_hash (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 (k, _, h) h1 -> (k ==> Rgl?.r_inv (hreg hash_size) h1 h) /\ loc_disjoint (loc_buffer (CB.cast buf)) (loc_buffer h) /\ modifies B.loc_none h0 h1)) = let rg = hreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else if sz - pos < hash_size then (false, pos, rg_dummy rg) else begin let hash = rg_alloc rg r in Lib.RawBuffer.blit (CB.cast buf) pos hash 0ul hash_size; (true, pos + hash_size, hash) end private let rec deserialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) (res:hash_vec #hash_size) (i:uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res)) (ensures (fun h0 _ h1 -> B.modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) = if not ok || pos >= sz then (false, pos) else begin let ok, pos, h = deserialize_hash ok buf sz r pos in if not ok then (false, pos) else begin V.assign res i h; (* * AR: 04/01: The call deserialize_hash_vec_i below needs liveness of buf * So we have to frame buf liveness for the V.assign call * V.assign provides a modifies postcondition in terms of * loc_vector_within, which is a recursive predicate and * I guess hard to reason about directly * Whereas to reason about liveness of buf, we only need an * overapproximation that V.assign modifies V.Vec?.vs res * Looking at the Vector library, I found the following lemma * that does the trick *) V.loc_vector_within_included res i (i + 1ul); let j = i + 1ul in if j < V.size_of res then deserialize_hash_vec_i ok buf sz r pos res j else (true, pos) end end private let deserialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash_vec #hash_size) (requires (fun h0 -> CB.live h0 buf))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val deserialize_hash_vec (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) : HST.ST (bool & uint32_t & hash_vec #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> B.modifies B.loc_none h0 h1))
[]
MerkleTree.Low.Serialization.deserialize_hash_vec
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> buf: MerkleTree.Low.Serialization.const_uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.ConstBuffer.length buf = FStar.UInt32.v sz} -> r: FStar.HyperStack.ST.erid -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST ((Prims.bool * MerkleTree.Low.Serialization.uint32_t) * MerkleTree.Low.Datastructures.hash_vec)
{ "end_col": 5, "end_line": 336, "start_col": 1, "start_line": 324 }
FStar.HyperStack.ST.ST
val deserialize_hash_vv (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) : HST.ST (bool & uint32_t & hash_vv hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> modifies B.loc_none h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let deserialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash_vv hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> modifies B.loc_none h0 h1)) = if not ok || pos >= sz then (false, pos, V.alloc_empty hash_vec) else begin let ok, pos, n = deserialize_uint32_t ok buf sz pos in if not ok then (false, pos, V.alloc_empty hash_vec) else if n = 0ul then (true, pos, V.alloc_empty hash_vec) else begin let rg = hvreg hash_size in let res = V.alloc n (rg_dummy rg) in let ok, pos = deserialize_hash_vv_i ok buf sz r pos res 0ul in (ok, pos, res) end end
val deserialize_hash_vv (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) : HST.ST (bool & uint32_t & hash_vv hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> modifies B.loc_none h0 h1)) let deserialize_hash_vv (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) : HST.ST (bool & uint32_t & hash_vv hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> modifies B.loc_none h0 h1)) =
true
null
false
if not ok || pos >= sz then (false, pos, V.alloc_empty hash_vec) else let ok, pos, n = deserialize_uint32_t ok buf sz pos in if not ok then (false, pos, V.alloc_empty hash_vec) else if n = 0ul then (true, pos, V.alloc_empty hash_vec) else let rg = hvreg hash_size in let res = V.alloc n (rg_dummy rg) in let ok, pos = deserialize_hash_vv_i ok buf sz r pos res 0ul in (ok, pos, res)
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Datastructures.hash_size_t", "Prims.bool", "MerkleTree.Low.Serialization.const_uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "Prims.int", "Prims.l_or", "Prims.op_GreaterThanOrEqual", "FStar.UInt.size", "FStar.UInt32.n", "LowStar.ConstBuffer.length", "MerkleTree.Low.Serialization.uint8_t", "FStar.UInt32.v", "FStar.HyperStack.ST.erid", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Integers.Unsigned", "FStar.Integers.W32", "FStar.Pervasives.Native.Mktuple3", "MerkleTree.Low.Datastructures.hash_vv", "LowStar.Vector.alloc_empty", "MerkleTree.Low.Datastructures.hash_vec", "FStar.Pervasives.Native.tuple3", "FStar.UInt32.t", "FStar.UInt32.__uint_to_t", "FStar.Pervasives.Native.tuple2", "MerkleTree.Low.Serialization.deserialize_hash_vv_i", "LowStar.Vector.vector", "LowStar.Vector.alloc", "LowStar.Regional.rg_dummy", "LowStar.Regional.regional", "MerkleTree.Low.Datastructures.hvreg", "MerkleTree.Low.Serialization.deserialize_uint32_t", "FStar.Monotonic.HyperStack.mem", "LowStar.ConstBuffer.live", "LowStar.Monotonic.Buffer.modifies", "LowStar.Monotonic.Buffer.loc_none" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end private let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with| 0uy -> false | _ -> true)) private let deserialize_uint8_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0uy) else (true, pos + 1ul, CB.index buf pos) private let deserialize_uint16_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0us) else begin let ok, pos, b0 = deserialize_uint8_t ok buf sz pos in let ok, pos, b1 = deserialize_uint8_t ok buf sz pos in (ok, pos, (U16.shift_left (Int.Cast.uint8_to_uint16 b0) 8ul) + Int.Cast.uint8_to_uint16 b1) end private let deserialize_uint32_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0ul) else begin let ok, pos, b0 = deserialize_uint16_t ok buf sz pos in let ok, pos, b1 = deserialize_uint16_t ok buf sz pos in (ok, pos, (U32.shift_left (Int.Cast.uint16_to_uint32 b0) 16ul) + Int.Cast.uint16_to_uint32 b1) end private let deserialize_uint64_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0UL) else begin let ok, pos, b0 = deserialize_uint32_t ok buf sz pos in let ok, pos, b1 = deserialize_uint32_t ok buf sz pos in (ok, pos, (U64.shift_left (u32_64 b0) 32ul) + u32_64 b1) end private let deserialize_offset_t = deserialize_uint64_t private let deserialize_index_t = deserialize_uint32_t private let deserialize_hash (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 (k, _, h) h1 -> (k ==> Rgl?.r_inv (hreg hash_size) h1 h) /\ loc_disjoint (loc_buffer (CB.cast buf)) (loc_buffer h) /\ modifies B.loc_none h0 h1)) = let rg = hreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else if sz - pos < hash_size then (false, pos, rg_dummy rg) else begin let hash = rg_alloc rg r in Lib.RawBuffer.blit (CB.cast buf) pos hash 0ul hash_size; (true, pos + hash_size, hash) end private let rec deserialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) (res:hash_vec #hash_size) (i:uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res)) (ensures (fun h0 _ h1 -> B.modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) = if not ok || pos >= sz then (false, pos) else begin let ok, pos, h = deserialize_hash ok buf sz r pos in if not ok then (false, pos) else begin V.assign res i h; (* * AR: 04/01: The call deserialize_hash_vec_i below needs liveness of buf * So we have to frame buf liveness for the V.assign call * V.assign provides a modifies postcondition in terms of * loc_vector_within, which is a recursive predicate and * I guess hard to reason about directly * Whereas to reason about liveness of buf, we only need an * overapproximation that V.assign modifies V.Vec?.vs res * Looking at the Vector library, I found the following lemma * that does the trick *) V.loc_vector_within_included res i (i + 1ul); let j = i + 1ul in if j < V.size_of res then deserialize_hash_vec_i ok buf sz r pos res j else (true, pos) end end private let deserialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash_vec #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> B.modifies B.loc_none h0 h1)) = let rg = hvreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else begin let ok, pos, n = deserialize_uint32_t ok buf sz pos in if not ok then (false, pos, V.alloc_empty hash) else if n = 0ul then (true, pos, V.alloc_empty hash) else begin let hrg = hreg hash_size in let res = V.alloc n (rg_dummy hrg) in let ok, pos = deserialize_hash_vec_i ok buf sz r pos res 0ul in (ok, pos, res) end end private let rec deserialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) (res:hash_vv hash_size) (i:uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res /\ B.loc_disjoint (CB.loc_buffer buf) (V.loc_vector res))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let ok, pos, hv = deserialize_hash_vec ok buf sz r pos in let h0 = HST.get() in if not ok then (false, pos) else begin V.assign res i hv; (* * AR: 04/01: The call deserialize_hash_vv_i below needs liveness of buf * So we have to frame buf liveness for the V.assign call * V.assign provides a modifies postcondition in terms of * loc_vector_within, which is a recursive predicate and * I guess hard to reason about directly * Whereas to reason about liveness of buf, we only need an * overapproximation that V.assign modifies V.Vec?.vs res * Looking at the Vector library, I found the following lemma * that does the trick *) V.loc_vector_within_included res i (i + 1ul); let j = i + 1ul in if j = V.size_of res then (true, pos) else deserialize_hash_vv_i ok buf sz r pos res j end end private let deserialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash_vv hash_size) (requires (fun h0 -> CB.live h0 buf))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val deserialize_hash_vv (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) : HST.ST (bool & uint32_t & hash_vv hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> modifies B.loc_none h0 h1))
[]
MerkleTree.Low.Serialization.deserialize_hash_vv
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> buf: MerkleTree.Low.Serialization.const_uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.ConstBuffer.length buf = FStar.UInt32.v sz} -> r: FStar.HyperStack.ST.erid -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST ((Prims.bool * MerkleTree.Low.Serialization.uint32_t) * MerkleTree.Low.Datastructures.hash_vv hash_size)
{ "end_col": 5, "end_line": 389, "start_col": 2, "start_line": 378 }
FStar.HyperStack.ST.ST
val deserialize_hash (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) : HST.ST (bool & uint32_t & hash #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 (k, _, h) h1 -> (k ==> Rgl?.r_inv (hreg hash_size) h1 h) /\ loc_disjoint (loc_buffer (CB.cast buf)) (loc_buffer h) /\ modifies B.loc_none h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let deserialize_hash (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 (k, _, h) h1 -> (k ==> Rgl?.r_inv (hreg hash_size) h1 h) /\ loc_disjoint (loc_buffer (CB.cast buf)) (loc_buffer h) /\ modifies B.loc_none h0 h1)) = let rg = hreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else if sz - pos < hash_size then (false, pos, rg_dummy rg) else begin let hash = rg_alloc rg r in Lib.RawBuffer.blit (CB.cast buf) pos hash 0ul hash_size; (true, pos + hash_size, hash) end
val deserialize_hash (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) : HST.ST (bool & uint32_t & hash #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 (k, _, h) h1 -> (k ==> Rgl?.r_inv (hreg hash_size) h1 h) /\ loc_disjoint (loc_buffer (CB.cast buf)) (loc_buffer h) /\ modifies B.loc_none h0 h1)) let deserialize_hash (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) : HST.ST (bool & uint32_t & hash #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 (k, _, h) h1 -> (k ==> Rgl?.r_inv (hreg hash_size) h1 h) /\ loc_disjoint (loc_buffer (CB.cast buf)) (loc_buffer h) /\ modifies B.loc_none h0 h1)) =
true
null
false
let rg = hreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else if sz - pos < hash_size then (false, pos, rg_dummy rg) else let hash = rg_alloc rg r in Lib.RawBuffer.blit (CB.cast buf) pos hash 0ul hash_size; (true, pos + hash_size, hash)
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Datastructures.hash_size_t", "Prims.bool", "MerkleTree.Low.Serialization.const_uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "Prims.int", "Prims.l_or", "Prims.op_GreaterThanOrEqual", "FStar.UInt.size", "FStar.UInt32.n", "LowStar.ConstBuffer.length", "MerkleTree.Low.Serialization.uint8_t", "FStar.UInt32.v", "FStar.HyperStack.ST.erid", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Integers.Unsigned", "FStar.Integers.W32", "FStar.Pervasives.Native.Mktuple3", "MerkleTree.Low.Datastructures.hash", "LowStar.Regional.rg_dummy", "FStar.Pervasives.Native.tuple3", "FStar.Integers.op_Less", "FStar.Integers.op_Subtraction", "FStar.Integers.op_Plus", "Prims.unit", "Lib.RawBuffer.blit", "LowStar.ConstBuffer.cast", "FStar.UInt32.__uint_to_t", "LowStar.Regional.rg_alloc", "LowStar.Regional.regional", "MerkleTree.Low.Datastructures.hreg", "FStar.Monotonic.HyperStack.mem", "LowStar.ConstBuffer.live", "Prims.l_and", "Prims.l_imp", "LowStar.Regional.__proj__Rgl__item__r_inv", "LowStar.Monotonic.Buffer.loc_disjoint", "LowStar.Monotonic.Buffer.loc_buffer", "LowStar.ConstBuffer.qbuf_pre", "LowStar.ConstBuffer.as_qbuf", "Lib.IntTypes.uint8", "LowStar.Buffer.trivial_preorder", "LowStar.Monotonic.Buffer.modifies", "LowStar.Monotonic.Buffer.loc_none" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end private let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with| 0uy -> false | _ -> true)) private let deserialize_uint8_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0uy) else (true, pos + 1ul, CB.index buf pos) private let deserialize_uint16_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0us) else begin let ok, pos, b0 = deserialize_uint8_t ok buf sz pos in let ok, pos, b1 = deserialize_uint8_t ok buf sz pos in (ok, pos, (U16.shift_left (Int.Cast.uint8_to_uint16 b0) 8ul) + Int.Cast.uint8_to_uint16 b1) end private let deserialize_uint32_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0ul) else begin let ok, pos, b0 = deserialize_uint16_t ok buf sz pos in let ok, pos, b1 = deserialize_uint16_t ok buf sz pos in (ok, pos, (U32.shift_left (Int.Cast.uint16_to_uint32 b0) 16ul) + Int.Cast.uint16_to_uint32 b1) end private let deserialize_uint64_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0UL) else begin let ok, pos, b0 = deserialize_uint32_t ok buf sz pos in let ok, pos, b1 = deserialize_uint32_t ok buf sz pos in (ok, pos, (U64.shift_left (u32_64 b0) 32ul) + u32_64 b1) end private let deserialize_offset_t = deserialize_uint64_t private let deserialize_index_t = deserialize_uint32_t private let deserialize_hash (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 (k, _, h) h1 -> (k ==> Rgl?.r_inv (hreg hash_size) h1 h) /\ loc_disjoint (loc_buffer (CB.cast buf)) (loc_buffer h) /\
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val deserialize_hash (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) : HST.ST (bool & uint32_t & hash #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 (k, _, h) h1 -> (k ==> Rgl?.r_inv (hreg hash_size) h1 h) /\ loc_disjoint (loc_buffer (CB.cast buf)) (loc_buffer h) /\ modifies B.loc_none h0 h1))
[]
MerkleTree.Low.Serialization.deserialize_hash
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> buf: MerkleTree.Low.Serialization.const_uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.ConstBuffer.length buf = FStar.UInt32.v sz} -> r: FStar.HyperStack.ST.erid -> pos: MerkleTree.Low.Serialization.uint32_t -> FStar.HyperStack.ST.ST ((Prims.bool * MerkleTree.Low.Serialization.uint32_t) * MerkleTree.Low.Datastructures.hash)
{ "end_col": 5, "end_line": 284, "start_col": 1, "start_line": 277 }
FStar.HyperStack.ST.ST
val serialize_hash_vec_i (#hash_size: hash_size_t) (ok: bool) (x: hash_vec #hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) (i: uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end
val serialize_hash_vec_i (#hash_size: hash_size_t) (ok: bool) (x: hash_vec #hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) (i: uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) let rec serialize_hash_vec_i (#hash_size: hash_size_t) (ok: bool) (x: hash_vec #hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) (i: uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) =
true
null
false
if not ok || pos >= sz then (false, 0ul) else let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos)
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Datastructures.hash_size_t", "Prims.bool", "MerkleTree.Low.Datastructures.hash_vec", "MerkleTree.Low.Serialization.uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "FStar.UInt32.t", "LowStar.Monotonic.Buffer.len", "MerkleTree.Low.Serialization.uint8_t", "LowStar.Buffer.trivial_preorder", "FStar.Integers.op_Less", "FStar.Integers.Unsigned", "FStar.Integers.W32", "LowStar.Vector.size_of", "MerkleTree.Low.Datastructures.hash", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Pervasives.Native.Mktuple2", "FStar.UInt32.__uint_to_t", "FStar.Pervasives.Native.tuple2", "MerkleTree.Low.Serialization.serialize_hash_vec_i", "FStar.Integers.int_t", "FStar.Integers.op_Plus", "MerkleTree.Low.Serialization.serialize_hash", "LowStar.Vector.index", "FStar.Monotonic.HyperStack.mem", "Prims.l_and", "LowStar.Monotonic.Buffer.live", "LowStar.RVector.rv_inv", "MerkleTree.Low.Datastructures.hreg", "LowStar.Monotonic.Buffer.loc_disjoint", "LowStar.Monotonic.Buffer.loc_buffer", "LowStar.RVector.loc_rvector", "LowStar.Monotonic.Buffer.modifies" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x)))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val serialize_hash_vec_i (#hash_size: hash_size_t) (ok: bool) (x: hash_vec #hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) (i: uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1))
[ "recursion" ]
MerkleTree.Low.Serialization.serialize_hash_vec_i
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> x: MerkleTree.Low.Datastructures.hash_vec -> buf: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.Monotonic.Buffer.len buf = sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> i: MerkleTree.Low.Serialization.uint32_t{i < LowStar.Vector.size_of x} -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 5, "end_line": 133, "start_col": 2, "start_line": 126 }
FStar.HyperStack.ST.ST
val mt_deserialize_path: rid:HST.erid -> input:const_uint8_p -> sz:uint64_t{CB.length input = U64.v sz} -> HST.ST (B.pointer_or_null path) (requires (fun h0 -> CB.live h0 input /\ HS.disjoint rid (B.frameOf (CB.cast input)))) (ensures (fun h0 r h1 -> modifies B.loc_none h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let mt_deserialize_path rid input sz = let sz = FStar.Int.Cast.uint64_to_uint32 sz in let hvvrid = HST.new_region rid in let ok, pos, hash_size = deserialize_uint32_t true input sz 0ul in if not ok || hash_size = 0ul then B.null #path else let ok, pos, hs = deserialize_hash_vec #hash_size ok input sz hvvrid pos in begin if not ok then (B.null #path) else (B.malloc rid (Path hash_size hs) 1ul) end
val mt_deserialize_path: rid:HST.erid -> input:const_uint8_p -> sz:uint64_t{CB.length input = U64.v sz} -> HST.ST (B.pointer_or_null path) (requires (fun h0 -> CB.live h0 input /\ HS.disjoint rid (B.frameOf (CB.cast input)))) (ensures (fun h0 r h1 -> modifies B.loc_none h0 h1)) let mt_deserialize_path rid input sz =
true
null
false
let sz = FStar.Int.Cast.uint64_to_uint32 sz in let hvvrid = HST.new_region rid in let ok, pos, hash_size = deserialize_uint32_t true input sz 0ul in if not ok || hash_size = 0ul then B.null #path else let ok, pos, hs = deserialize_hash_vec #hash_size ok input sz hvvrid pos in if not ok then (B.null #path) else (B.malloc rid (Path hash_size hs) 1ul)
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "FStar.HyperStack.ST.erid", "MerkleTree.Low.Serialization.const_uint8_p", "MerkleTree.Low.Serialization.uint64_t", "Prims.b2t", "Prims.op_Equality", "Prims.int", "Prims.l_or", "Prims.op_GreaterThanOrEqual", "FStar.UInt.size", "FStar.UInt64.n", "LowStar.ConstBuffer.length", "MerkleTree.Low.Serialization.uint8_t", "FStar.UInt64.v", "Prims.bool", "MerkleTree.Low.Serialization.uint32_t", "Prims.op_BarBar", "Prims.op_Negation", "FStar.UInt32.t", "FStar.UInt32.__uint_to_t", "LowStar.Buffer.null", "MerkleTree.Low.path", "LowStar.Buffer.pointer_or_null", "MerkleTree.Low.Datastructures.hash_vec", "LowStar.Buffer.malloc", "MerkleTree.Low.Path", "LowStar.Monotonic.Buffer.mbuffer", "LowStar.Buffer.trivial_preorder", "Prims.l_and", "Prims.eq2", "Prims.nat", "LowStar.Monotonic.Buffer.length", "FStar.UInt32.v", "LowStar.Monotonic.Buffer.g_is_null", "FStar.Monotonic.HyperHeap.rid", "LowStar.Monotonic.Buffer.frameOf", "LowStar.Monotonic.Buffer.freeable", "FStar.Pervasives.Native.tuple3", "MerkleTree.Low.Serialization.deserialize_hash_vec", "MerkleTree.Low.Serialization.deserialize_uint32_t", "FStar.HyperStack.ST.new_region", "Prims.op_Modulus", "Prims.pow2", "FStar.Int.Cast.uint64_to_uint32" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end private let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with| 0uy -> false | _ -> true)) private let deserialize_uint8_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0uy) else (true, pos + 1ul, CB.index buf pos) private let deserialize_uint16_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0us) else begin let ok, pos, b0 = deserialize_uint8_t ok buf sz pos in let ok, pos, b1 = deserialize_uint8_t ok buf sz pos in (ok, pos, (U16.shift_left (Int.Cast.uint8_to_uint16 b0) 8ul) + Int.Cast.uint8_to_uint16 b1) end private let deserialize_uint32_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0ul) else begin let ok, pos, b0 = deserialize_uint16_t ok buf sz pos in let ok, pos, b1 = deserialize_uint16_t ok buf sz pos in (ok, pos, (U32.shift_left (Int.Cast.uint16_to_uint32 b0) 16ul) + Int.Cast.uint16_to_uint32 b1) end private let deserialize_uint64_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0UL) else begin let ok, pos, b0 = deserialize_uint32_t ok buf sz pos in let ok, pos, b1 = deserialize_uint32_t ok buf sz pos in (ok, pos, (U64.shift_left (u32_64 b0) 32ul) + u32_64 b1) end private let deserialize_offset_t = deserialize_uint64_t private let deserialize_index_t = deserialize_uint32_t private let deserialize_hash (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 (k, _, h) h1 -> (k ==> Rgl?.r_inv (hreg hash_size) h1 h) /\ loc_disjoint (loc_buffer (CB.cast buf)) (loc_buffer h) /\ modifies B.loc_none h0 h1)) = let rg = hreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else if sz - pos < hash_size then (false, pos, rg_dummy rg) else begin let hash = rg_alloc rg r in Lib.RawBuffer.blit (CB.cast buf) pos hash 0ul hash_size; (true, pos + hash_size, hash) end private let rec deserialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) (res:hash_vec #hash_size) (i:uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res)) (ensures (fun h0 _ h1 -> B.modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) = if not ok || pos >= sz then (false, pos) else begin let ok, pos, h = deserialize_hash ok buf sz r pos in if not ok then (false, pos) else begin V.assign res i h; (* * AR: 04/01: The call deserialize_hash_vec_i below needs liveness of buf * So we have to frame buf liveness for the V.assign call * V.assign provides a modifies postcondition in terms of * loc_vector_within, which is a recursive predicate and * I guess hard to reason about directly * Whereas to reason about liveness of buf, we only need an * overapproximation that V.assign modifies V.Vec?.vs res * Looking at the Vector library, I found the following lemma * that does the trick *) V.loc_vector_within_included res i (i + 1ul); let j = i + 1ul in if j < V.size_of res then deserialize_hash_vec_i ok buf sz r pos res j else (true, pos) end end private let deserialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash_vec #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> B.modifies B.loc_none h0 h1)) = let rg = hvreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else begin let ok, pos, n = deserialize_uint32_t ok buf sz pos in if not ok then (false, pos, V.alloc_empty hash) else if n = 0ul then (true, pos, V.alloc_empty hash) else begin let hrg = hreg hash_size in let res = V.alloc n (rg_dummy hrg) in let ok, pos = deserialize_hash_vec_i ok buf sz r pos res 0ul in (ok, pos, res) end end private let rec deserialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) (res:hash_vv hash_size) (i:uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res /\ B.loc_disjoint (CB.loc_buffer buf) (V.loc_vector res))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let ok, pos, hv = deserialize_hash_vec ok buf sz r pos in let h0 = HST.get() in if not ok then (false, pos) else begin V.assign res i hv; (* * AR: 04/01: The call deserialize_hash_vv_i below needs liveness of buf * So we have to frame buf liveness for the V.assign call * V.assign provides a modifies postcondition in terms of * loc_vector_within, which is a recursive predicate and * I guess hard to reason about directly * Whereas to reason about liveness of buf, we only need an * overapproximation that V.assign modifies V.Vec?.vs res * Looking at the Vector library, I found the following lemma * that does the trick *) V.loc_vector_within_included res i (i + 1ul); let j = i + 1ul in if j = V.size_of res then (true, pos) else deserialize_hash_vv_i ok buf sz r pos res j end end private let deserialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash_vv hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> modifies B.loc_none h0 h1)) = if not ok || pos >= sz then (false, pos, V.alloc_empty hash_vec) else begin let ok, pos, n = deserialize_uint32_t ok buf sz pos in if not ok then (false, pos, V.alloc_empty hash_vec) else if n = 0ul then (true, pos, V.alloc_empty hash_vec) else begin let rg = hvreg hash_size in let res = V.alloc n (rg_dummy rg) in let ok, pos = deserialize_hash_vv_i ok buf sz r pos res 0ul in (ok, pos, res) end end #push-options "--z3rlimit 10" val mt_serialize_size: mt:const_mt_p -> HST.ST uint64_t (requires (fun h0 -> mt_safe h0 (CB.cast mt))) (ensures (fun _ _ h1 -> mt_safe h1 (CB.cast mt))) let mt_serialize_size mt = let mtv = !*(CB.cast mt) in let hs = MT?.hs mtv in let rhs_ok = MT?.rhs_ok mtv in let rhs = MT?.rhs mtv in let hs_sz = hash_vv_bytes hs in if hs_sz < uint32_max then 1UL + // format version 4UL + // hash_size 8UL + // offset 4UL + 4UL + // i, j hs_sz + // hs 1UL + // rhs_ok hash_vec_bytes rhs + // rhs u32_64 (MT?.hash_size mtv) // mroot else uint64_max #pop-options #push-options "--z3rlimit 15 --initial_fuel 1 --max_fuel 1" val mt_serialize: mt:const_mt_p -> output:uint8_p -> sz:uint64_t -> HST.ST uint64_t (requires (fun h0 -> mt_safe h0 (CB.cast mt) /\ B.live h0 output /\ B.length output = U64.v sz /\ HS.disjoint (B.frameOf output) (B.frameOf (CB.cast mt)))) (ensures (fun h0 _ h1 -> mt_safe h1 (CB.cast mt) /\ modifies (B.loc_buffer output) h0 h1)) let mt_serialize mt output sz = let mt = CB.cast mt in let sz = FStar.Int.Cast.uint64_to_uint32 sz in let mtv = !*mt in let h0 = HST.get() in let ok, pos = serialize_uint8_t true 1uy output sz 0ul in // format version = 1uy let h1 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h0 h1; let ok, pos = serialize_uint32_t ok (MT?.hash_size mtv) output sz pos in let h2 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h1 h2; let ok, pos = serialize_offset_t ok (MT?.offset mtv) output sz pos in let h3 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h2 h3; let ok, pos = serialize_uint32_t ok (MT?.i mtv) output sz pos in let h4 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h3 h4; let ok, pos = serialize_uint32_t ok (MT?.j mtv) output sz pos in let h5 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h4 h5; let ok, pos = serialize_hash_vv ok (MT?.hs mtv) output sz pos in let h6 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h5 h6; let ok, pos = serialize_bool ok (MT?.rhs_ok mtv) output sz pos in let h7 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h6 h7; let ok, pos = serialize_hash_vec ok (MT?.rhs mtv) output sz pos in let h8 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h7 h8; let ok, pos = serialize_hash ok (MT?.mroot mtv) output sz pos in let h9 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h8 h9; if ok then (FStar.Int.Cast.uint32_to_uint64 pos) else 0UL #pop-options #push-options "--z3rlimit 15 --initial_fuel 2 --max_fuel 2 --initial_ifuel 1 --max_ifuel 1" val mt_deserialize: #hsz:Ghost.erased hash_size_t -> rid:HST.erid -> input:const_uint8_p -> sz:uint64_t{CB.length input = U64.v sz} -> hash_spec:Ghost.erased(MTS.hash_fun_t #(U32.v (Ghost.reveal hsz))) -> hash_fun:hash_fun_t #(Ghost.reveal hsz) #hash_spec -> HST.ST (B.pointer_or_null merkle_tree) (requires (fun h0 -> CB.live h0 input /\ HS.disjoint rid (B.frameOf (CB.cast input)))) (ensures (fun h0 r h1 -> modifies B.loc_none h0 h1 /\ (not (g_is_null r)) ==> MT?.hash_size (B.get h1 r 0) = Ghost.reveal hsz)) let mt_deserialize #ghsz rid input sz hash_spec hash_fun = let sz = FStar.Int.Cast.uint64_to_uint32 sz in let hrid = HST.new_region rid in let hvrid = HST.new_region rid in let hvvrid = HST.new_region rid in let ok, pos, format_version = deserialize_uint8_t true input sz 0ul in let ok = ok && format_version = 1uy in let ok, pos, hsz = deserialize_uint32_t ok input sz pos in if hsz = 0ul then B.null #merkle_tree else begin let ok, pos, offset = deserialize_offset_t ok input sz pos in let ok, pos, i = deserialize_index_t ok input sz pos in let ok, pos, j = deserialize_index_t ok input sz pos in let ok, pos, hs = deserialize_hash_vv #hsz ok input sz hvvrid pos in let ok, pos, rhs_ok = deserialize_bool ok input sz pos in let ok, pos, rhs = deserialize_hash_vec #hsz ok input sz hvrid pos in let ok, pos, mroot = deserialize_hash #hsz ok input sz hrid pos in begin if not ok || not (merkle_tree_conditions #hsz offset i j hs rhs_ok rhs mroot) then B.null #merkle_tree else begin assume (hsz = Ghost.reveal ghsz); // We trust the user to provide a suitable hash_fun. B.malloc rid (MT hsz offset i j hs rhs_ok rhs mroot hash_spec hash_fun) 1ul end end end val mt_serialize_path: #hsz:Ghost.erased hash_size_t -> p:const_path_p -> output:uint8_p -> sz:uint64_t -> HST.ST uint64_t (requires (fun h0 -> let ncp = CB.cast p in let phv = B.get h0 ncp 0 in Path?.hash_size phv = Ghost.reveal hsz /\ path_safe h0 (B.frameOf (CB.cast p)) ncp /\ RV.rv_inv #(hash #hsz) #hash_size_t #(hreg hsz) h0 (Path?.hashes phv) /\ B.live h0 output /\ B.length output = U64.v sz /\ HS.disjoint (B.frameOf output) (B.frameOf ncp))) (ensures (fun h0 _ h1 -> path_safe h1 (B.frameOf (CB.cast p)) (CB.cast p) /\ modifies (B.loc_buffer output) h0 h1)) let mt_serialize_path #hsz p output sz = let hsz = Path?.hash_size !*(CB.cast p) in let sz = FStar.Int.Cast.uint64_to_uint32 sz in let ncp = CB.cast p in let h0 = HST.get() in let ok, pos = serialize_uint32_t true hsz output sz 0ul in let h1 = HST.get() in let ncpd = !*ncp in let ok, pos = serialize_hash_vec #hsz ok (Path?.hashes ncpd) output sz pos in if ok then (FStar.Int.Cast.uint32_to_uint64 pos) else 0UL val mt_deserialize_path: rid:HST.erid -> input:const_uint8_p -> sz:uint64_t{CB.length input = U64.v sz} -> HST.ST (B.pointer_or_null path) (requires (fun h0 -> CB.live h0 input /\ HS.disjoint rid (B.frameOf (CB.cast input))))
false
false
MerkleTree.Low.Serialization.fst
{ "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": 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": 15, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val mt_deserialize_path: rid:HST.erid -> input:const_uint8_p -> sz:uint64_t{CB.length input = U64.v sz} -> HST.ST (B.pointer_or_null path) (requires (fun h0 -> CB.live h0 input /\ HS.disjoint rid (B.frameOf (CB.cast input)))) (ensures (fun h0 r h1 -> modifies B.loc_none h0 h1))
[]
MerkleTree.Low.Serialization.mt_deserialize_path
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
rid: FStar.HyperStack.ST.erid -> input: MerkleTree.Low.Serialization.const_uint8_p -> sz: MerkleTree.Low.Serialization.uint64_t{LowStar.ConstBuffer.length input = FStar.UInt64.v sz} -> FStar.HyperStack.ST.ST (LowStar.Buffer.pointer_or_null MerkleTree.Low.path)
{ "end_col": 7, "end_line": 521, "start_col": 38, "start_line": 510 }
FStar.HyperStack.ST.ST
val serialize_hash_vv_i (#hash_size: hash_size_t) (ok: bool) (x: hash_vv hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) (i: uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end
val serialize_hash_vv_i (#hash_size: hash_size_t) (ok: bool) (x: hash_vv hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) (i: uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) let rec serialize_hash_vv_i (#hash_size: hash_size_t) (ok: bool) (x: hash_vv hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) (i: uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) =
true
null
false
if not ok || pos >= sz then (false, 0ul) else let vi = V.index x i in let h0 = HST.get () in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get () in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos)
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Datastructures.hash_size_t", "Prims.bool", "MerkleTree.Low.Datastructures.hash_vv", "MerkleTree.Low.Serialization.uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "FStar.UInt32.t", "LowStar.Monotonic.Buffer.len", "MerkleTree.Low.Serialization.uint8_t", "LowStar.Buffer.trivial_preorder", "FStar.Integers.op_Less", "FStar.Integers.Unsigned", "FStar.Integers.W32", "LowStar.Vector.size_of", "MerkleTree.Low.Datastructures.hash_vec", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Pervasives.Native.Mktuple2", "FStar.UInt32.__uint_to_t", "FStar.Pervasives.Native.tuple2", "MerkleTree.Low.Serialization.serialize_hash_vv_i", "FStar.Integers.int_t", "FStar.Integers.op_Plus", "Prims.unit", "LowStar.RVector.rv_inv_preserved", "MerkleTree.Low.Datastructures.hvreg", "LowStar.Monotonic.Buffer.loc_buffer", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "MerkleTree.Low.Serialization.serialize_hash_vec", "LowStar.Vector.index", "Prims.l_and", "LowStar.Monotonic.Buffer.live", "LowStar.RVector.rv_inv", "FStar.Monotonic.HyperHeap.disjoint", "LowStar.Monotonic.Buffer.frameOf", "LowStar.Regional.__proj__Rgl__item__region_of", "LowStar.Regional.regional", "MerkleTree.Low.Datastructures.hvvreg", "LowStar.Monotonic.Buffer.modifies" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x)))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val serialize_hash_vv_i (#hash_size: hash_size_t) (ok: bool) (x: hash_vv hash_size) (buf: uint8_p) (sz: uint32_t{B.len buf = sz}) (pos: uint32_t) (i: uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1))
[ "recursion" ]
MerkleTree.Low.Serialization.serialize_hash_vv_i
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> x: MerkleTree.Low.Datastructures.hash_vv hash_size -> buf: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.Monotonic.Buffer.len buf = sz} -> pos: MerkleTree.Low.Serialization.uint32_t -> i: MerkleTree.Low.Serialization.uint32_t{i < LowStar.Vector.size_of x} -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 5, "end_line": 199, "start_col": 2, "start_line": 188 }
FStar.HyperStack.ST.ST
val deserialize_hash_vv_i (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) (res: hash_vv hash_size) (i: uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res /\ B.loc_disjoint (CB.loc_buffer buf) (V.loc_vector res) )) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let rec deserialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) (res:hash_vv hash_size) (i:uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res /\ B.loc_disjoint (CB.loc_buffer buf) (V.loc_vector res))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let ok, pos, hv = deserialize_hash_vec ok buf sz r pos in let h0 = HST.get() in if not ok then (false, pos) else begin V.assign res i hv; (* * AR: 04/01: The call deserialize_hash_vv_i below needs liveness of buf * So we have to frame buf liveness for the V.assign call * V.assign provides a modifies postcondition in terms of * loc_vector_within, which is a recursive predicate and * I guess hard to reason about directly * Whereas to reason about liveness of buf, we only need an * overapproximation that V.assign modifies V.Vec?.vs res * Looking at the Vector library, I found the following lemma * that does the trick *) V.loc_vector_within_included res i (i + 1ul); let j = i + 1ul in if j = V.size_of res then (true, pos) else deserialize_hash_vv_i ok buf sz r pos res j end end
val deserialize_hash_vv_i (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) (res: hash_vv hash_size) (i: uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res /\ B.loc_disjoint (CB.loc_buffer buf) (V.loc_vector res) )) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) let rec deserialize_hash_vv_i (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) (res: hash_vv hash_size) (i: uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res /\ B.loc_disjoint (CB.loc_buffer buf) (V.loc_vector res) )) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) =
true
null
false
if not ok || pos >= sz then (false, 0ul) else let ok, pos, hv = deserialize_hash_vec ok buf sz r pos in let h0 = HST.get () in if not ok then (false, pos) else (V.assign res i hv; V.loc_vector_within_included res i (i + 1ul); let j = i + 1ul in if j = V.size_of res then (true, pos) else deserialize_hash_vv_i ok buf sz r pos res j)
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.Datastructures.hash_size_t", "Prims.bool", "MerkleTree.Low.Serialization.const_uint8_p", "MerkleTree.Low.Serialization.uint32_t", "Prims.b2t", "Prims.op_Equality", "Prims.int", "Prims.l_or", "Prims.op_GreaterThanOrEqual", "FStar.UInt.size", "FStar.UInt32.n", "LowStar.ConstBuffer.length", "MerkleTree.Low.Serialization.uint8_t", "FStar.UInt32.v", "FStar.HyperStack.ST.erid", "MerkleTree.Low.Datastructures.hash_vv", "FStar.Integers.op_Less", "FStar.Integers.Unsigned", "FStar.Integers.W32", "LowStar.Vector.size_of", "MerkleTree.Low.Datastructures.hash_vec", "Prims.op_BarBar", "Prims.op_Negation", "FStar.Integers.op_Greater_Equals", "FStar.Pervasives.Native.Mktuple2", "FStar.UInt32.__uint_to_t", "FStar.Pervasives.Native.tuple2", "FStar.UInt32.t", "MerkleTree.Low.Serialization.deserialize_hash_vv_i", "FStar.Integers.int_t", "FStar.Integers.op_Plus", "Prims.unit", "LowStar.Vector.loc_vector_within_included", "LowStar.Vector.assign", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "FStar.Pervasives.Native.tuple3", "MerkleTree.Low.Serialization.deserialize_hash_vec", "Prims.l_and", "LowStar.ConstBuffer.live", "LowStar.Vector.live", "LowStar.Monotonic.Buffer.loc_disjoint", "LowStar.ConstBuffer.loc_buffer", "LowStar.Vector.loc_vector", "LowStar.Monotonic.Buffer.modifies", "LowStar.Monotonic.Buffer.loc_buffer", "LowStar.Buffer.trivial_preorder", "LowStar.Vector.__proj__Vec__item__vs" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end private let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with| 0uy -> false | _ -> true)) private let deserialize_uint8_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0uy) else (true, pos + 1ul, CB.index buf pos) private let deserialize_uint16_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0us) else begin let ok, pos, b0 = deserialize_uint8_t ok buf sz pos in let ok, pos, b1 = deserialize_uint8_t ok buf sz pos in (ok, pos, (U16.shift_left (Int.Cast.uint8_to_uint16 b0) 8ul) + Int.Cast.uint8_to_uint16 b1) end private let deserialize_uint32_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0ul) else begin let ok, pos, b0 = deserialize_uint16_t ok buf sz pos in let ok, pos, b1 = deserialize_uint16_t ok buf sz pos in (ok, pos, (U32.shift_left (Int.Cast.uint16_to_uint32 b0) 16ul) + Int.Cast.uint16_to_uint32 b1) end private let deserialize_uint64_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0UL) else begin let ok, pos, b0 = deserialize_uint32_t ok buf sz pos in let ok, pos, b1 = deserialize_uint32_t ok buf sz pos in (ok, pos, (U64.shift_left (u32_64 b0) 32ul) + u32_64 b1) end private let deserialize_offset_t = deserialize_uint64_t private let deserialize_index_t = deserialize_uint32_t private let deserialize_hash (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 (k, _, h) h1 -> (k ==> Rgl?.r_inv (hreg hash_size) h1 h) /\ loc_disjoint (loc_buffer (CB.cast buf)) (loc_buffer h) /\ modifies B.loc_none h0 h1)) = let rg = hreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else if sz - pos < hash_size then (false, pos, rg_dummy rg) else begin let hash = rg_alloc rg r in Lib.RawBuffer.blit (CB.cast buf) pos hash 0ul hash_size; (true, pos + hash_size, hash) end private let rec deserialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) (res:hash_vec #hash_size) (i:uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res)) (ensures (fun h0 _ h1 -> B.modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) = if not ok || pos >= sz then (false, pos) else begin let ok, pos, h = deserialize_hash ok buf sz r pos in if not ok then (false, pos) else begin V.assign res i h; (* * AR: 04/01: The call deserialize_hash_vec_i below needs liveness of buf * So we have to frame buf liveness for the V.assign call * V.assign provides a modifies postcondition in terms of * loc_vector_within, which is a recursive predicate and * I guess hard to reason about directly * Whereas to reason about liveness of buf, we only need an * overapproximation that V.assign modifies V.Vec?.vs res * Looking at the Vector library, I found the following lemma * that does the trick *) V.loc_vector_within_included res i (i + 1ul); let j = i + 1ul in if j < V.size_of res then deserialize_hash_vec_i ok buf sz r pos res j else (true, pos) end end private let deserialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash_vec #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> B.modifies B.loc_none h0 h1)) = let rg = hvreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else begin let ok, pos, n = deserialize_uint32_t ok buf sz pos in if not ok then (false, pos, V.alloc_empty hash) else if n = 0ul then (true, pos, V.alloc_empty hash) else begin let hrg = hreg hash_size in let res = V.alloc n (rg_dummy hrg) in let ok, pos = deserialize_hash_vec_i ok buf sz r pos res 0ul in (ok, pos, res) end end private let rec deserialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) (res:hash_vv hash_size) (i:uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res /\ B.loc_disjoint (CB.loc_buffer buf) (V.loc_vector res))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val deserialize_hash_vv_i (#hash_size: hash_size_t) (ok: bool) (buf: const_uint8_p) (sz: uint32_t{CB.length buf = U32.v sz}) (r: HST.erid) (pos: uint32_t) (res: hash_vv hash_size) (i: uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res /\ B.loc_disjoint (CB.loc_buffer buf) (V.loc_vector res) )) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1))
[ "recursion" ]
MerkleTree.Low.Serialization.deserialize_hash_vv_i
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
ok: Prims.bool -> buf: MerkleTree.Low.Serialization.const_uint8_p -> sz: MerkleTree.Low.Serialization.uint32_t{LowStar.ConstBuffer.length buf = FStar.UInt32.v sz} -> r: FStar.HyperStack.ST.erid -> pos: MerkleTree.Low.Serialization.uint32_t -> res: MerkleTree.Low.Datastructures.hash_vv hash_size -> i: MerkleTree.Low.Serialization.uint32_t{i < LowStar.Vector.size_of res} -> FStar.HyperStack.ST.ST (Prims.bool * MerkleTree.Low.Serialization.uint32_t)
{ "end_col": 5, "end_line": 370, "start_col": 2, "start_line": 347 }
FStar.HyperStack.ST.ST
val mt_serialize_size: mt:const_mt_p -> HST.ST uint64_t (requires (fun h0 -> mt_safe h0 (CB.cast mt))) (ensures (fun _ _ h1 -> mt_safe h1 (CB.cast mt)))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let mt_serialize_size mt = let mtv = !*(CB.cast mt) in let hs = MT?.hs mtv in let rhs_ok = MT?.rhs_ok mtv in let rhs = MT?.rhs mtv in let hs_sz = hash_vv_bytes hs in if hs_sz < uint32_max then 1UL + // format version 4UL + // hash_size 8UL + // offset 4UL + 4UL + // i, j hs_sz + // hs 1UL + // rhs_ok hash_vec_bytes rhs + // rhs u32_64 (MT?.hash_size mtv) // mroot else uint64_max
val mt_serialize_size: mt:const_mt_p -> HST.ST uint64_t (requires (fun h0 -> mt_safe h0 (CB.cast mt))) (ensures (fun _ _ h1 -> mt_safe h1 (CB.cast mt))) let mt_serialize_size mt =
true
null
false
let mtv = !*(CB.cast mt) in let hs = MT?.hs mtv in let rhs_ok = MT?.rhs_ok mtv in let rhs = MT?.rhs mtv in let hs_sz = hash_vv_bytes hs in if hs_sz < uint32_max then 1uL + 4uL + 8uL + 4uL + 4uL + hs_sz + 1uL + hash_vec_bytes rhs + u32_64 (MT?.hash_size mtv) else uint64_max
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.const_mt_p", "FStar.Integers.op_Less", "FStar.Integers.Unsigned", "FStar.Integers.W64", "MerkleTree.Low.uint32_max", "FStar.Integers.op_Plus", "FStar.UInt64.__uint_to_t", "MerkleTree.Low.Serialization.hash_vec_bytes", "MerkleTree.Low.__proj__MT__item__hash_size", "MerkleTree.Low.u32_64", "Prims.bool", "MerkleTree.Low.uint64_max", "MerkleTree.Low.Serialization.uint64_t", "MerkleTree.Low.Serialization.hash_vv_bytes", "MerkleTree.Low.Datastructures.hash_vec", "Prims.b2t", "Prims.op_Equality", "LowStar.Vector.uint32_t", "LowStar.Vector.size_of", "MerkleTree.Low.Datastructures.hash", "MerkleTree.Low.merkle_tree_size_lg", "MerkleTree.Low.__proj__MT__item__rhs", "MerkleTree.Low.__proj__MT__item__rhs_ok", "MerkleTree.Low.Datastructures.hash_vv", "MerkleTree.Low.__proj__MT__item__hs", "MerkleTree.Low.merkle_tree", "LowStar.BufferOps.op_Bang_Star", "LowStar.ConstBuffer.qbuf_pre", "LowStar.ConstBuffer.as_qbuf", "LowStar.ConstBuffer.cast" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end private let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with| 0uy -> false | _ -> true)) private let deserialize_uint8_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0uy) else (true, pos + 1ul, CB.index buf pos) private let deserialize_uint16_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0us) else begin let ok, pos, b0 = deserialize_uint8_t ok buf sz pos in let ok, pos, b1 = deserialize_uint8_t ok buf sz pos in (ok, pos, (U16.shift_left (Int.Cast.uint8_to_uint16 b0) 8ul) + Int.Cast.uint8_to_uint16 b1) end private let deserialize_uint32_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0ul) else begin let ok, pos, b0 = deserialize_uint16_t ok buf sz pos in let ok, pos, b1 = deserialize_uint16_t ok buf sz pos in (ok, pos, (U32.shift_left (Int.Cast.uint16_to_uint32 b0) 16ul) + Int.Cast.uint16_to_uint32 b1) end private let deserialize_uint64_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0UL) else begin let ok, pos, b0 = deserialize_uint32_t ok buf sz pos in let ok, pos, b1 = deserialize_uint32_t ok buf sz pos in (ok, pos, (U64.shift_left (u32_64 b0) 32ul) + u32_64 b1) end private let deserialize_offset_t = deserialize_uint64_t private let deserialize_index_t = deserialize_uint32_t private let deserialize_hash (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 (k, _, h) h1 -> (k ==> Rgl?.r_inv (hreg hash_size) h1 h) /\ loc_disjoint (loc_buffer (CB.cast buf)) (loc_buffer h) /\ modifies B.loc_none h0 h1)) = let rg = hreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else if sz - pos < hash_size then (false, pos, rg_dummy rg) else begin let hash = rg_alloc rg r in Lib.RawBuffer.blit (CB.cast buf) pos hash 0ul hash_size; (true, pos + hash_size, hash) end private let rec deserialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) (res:hash_vec #hash_size) (i:uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res)) (ensures (fun h0 _ h1 -> B.modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) = if not ok || pos >= sz then (false, pos) else begin let ok, pos, h = deserialize_hash ok buf sz r pos in if not ok then (false, pos) else begin V.assign res i h; (* * AR: 04/01: The call deserialize_hash_vec_i below needs liveness of buf * So we have to frame buf liveness for the V.assign call * V.assign provides a modifies postcondition in terms of * loc_vector_within, which is a recursive predicate and * I guess hard to reason about directly * Whereas to reason about liveness of buf, we only need an * overapproximation that V.assign modifies V.Vec?.vs res * Looking at the Vector library, I found the following lemma * that does the trick *) V.loc_vector_within_included res i (i + 1ul); let j = i + 1ul in if j < V.size_of res then deserialize_hash_vec_i ok buf sz r pos res j else (true, pos) end end private let deserialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash_vec #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> B.modifies B.loc_none h0 h1)) = let rg = hvreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else begin let ok, pos, n = deserialize_uint32_t ok buf sz pos in if not ok then (false, pos, V.alloc_empty hash) else if n = 0ul then (true, pos, V.alloc_empty hash) else begin let hrg = hreg hash_size in let res = V.alloc n (rg_dummy hrg) in let ok, pos = deserialize_hash_vec_i ok buf sz r pos res 0ul in (ok, pos, res) end end private let rec deserialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) (res:hash_vv hash_size) (i:uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res /\ B.loc_disjoint (CB.loc_buffer buf) (V.loc_vector res))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let ok, pos, hv = deserialize_hash_vec ok buf sz r pos in let h0 = HST.get() in if not ok then (false, pos) else begin V.assign res i hv; (* * AR: 04/01: The call deserialize_hash_vv_i below needs liveness of buf * So we have to frame buf liveness for the V.assign call * V.assign provides a modifies postcondition in terms of * loc_vector_within, which is a recursive predicate and * I guess hard to reason about directly * Whereas to reason about liveness of buf, we only need an * overapproximation that V.assign modifies V.Vec?.vs res * Looking at the Vector library, I found the following lemma * that does the trick *) V.loc_vector_within_included res i (i + 1ul); let j = i + 1ul in if j = V.size_of res then (true, pos) else deserialize_hash_vv_i ok buf sz r pos res j end end private let deserialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash_vv hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> modifies B.loc_none h0 h1)) = if not ok || pos >= sz then (false, pos, V.alloc_empty hash_vec) else begin let ok, pos, n = deserialize_uint32_t ok buf sz pos in if not ok then (false, pos, V.alloc_empty hash_vec) else if n = 0ul then (true, pos, V.alloc_empty hash_vec) else begin let rg = hvreg hash_size in let res = V.alloc n (rg_dummy rg) in let ok, pos = deserialize_hash_vv_i ok buf sz r pos res 0ul in (ok, pos, res) end end #push-options "--z3rlimit 10" val mt_serialize_size: mt:const_mt_p -> HST.ST uint64_t (requires (fun h0 -> mt_safe h0 (CB.cast mt)))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 10, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val mt_serialize_size: mt:const_mt_p -> HST.ST uint64_t (requires (fun h0 -> mt_safe h0 (CB.cast mt))) (ensures (fun _ _ h1 -> mt_safe h1 (CB.cast mt)))
[]
MerkleTree.Low.Serialization.mt_serialize_size
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
mt: MerkleTree.Low.const_mt_p -> FStar.HyperStack.ST.ST MerkleTree.Low.Serialization.uint64_t
{ "end_col": 15, "end_line": 411, "start_col": 26, "start_line": 395 }
FStar.HyperStack.ST.ST
val mt_serialize: mt:const_mt_p -> output:uint8_p -> sz:uint64_t -> HST.ST uint64_t (requires (fun h0 -> mt_safe h0 (CB.cast mt) /\ B.live h0 output /\ B.length output = U64.v sz /\ HS.disjoint (B.frameOf output) (B.frameOf (CB.cast mt)))) (ensures (fun h0 _ h1 -> mt_safe h1 (CB.cast mt) /\ modifies (B.loc_buffer output) h0 h1))
[ { "abbrev": true, "full_module": "MerkleTree.Spec", "short_module": "MTS" }, { "abbrev": false, "full_module": "MerkleTree.Low.Hashfunctions", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low.Datastructures", "short_module": null }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.UInt16", "short_module": "U16" }, { "abbrev": true, "full_module": "LowStar.Regional.Instances", "short_module": "RVI" }, { "abbrev": true, "full_module": "LowStar.RVector", "short_module": "RV" }, { "abbrev": true, "full_module": "LowStar.Vector", "short_module": "V" }, { "abbrev": true, "full_module": "LowStar.ConstBuffer", "short_module": "CB" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.Monotonic.HyperHeap", "short_module": "HH" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional.Instances", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Regional", "short_module": null }, { "abbrev": false, "full_module": "LowStar.RVector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Vector", "short_module": null }, { "abbrev": false, "full_module": "LowStar.BufferOps", "short_module": null }, { "abbrev": false, "full_module": "LowStar.Modifies", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "FStar.Integers", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "MerkleTree.Low", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let mt_serialize mt output sz = let mt = CB.cast mt in let sz = FStar.Int.Cast.uint64_to_uint32 sz in let mtv = !*mt in let h0 = HST.get() in let ok, pos = serialize_uint8_t true 1uy output sz 0ul in // format version = 1uy let h1 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h0 h1; let ok, pos = serialize_uint32_t ok (MT?.hash_size mtv) output sz pos in let h2 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h1 h2; let ok, pos = serialize_offset_t ok (MT?.offset mtv) output sz pos in let h3 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h2 h3; let ok, pos = serialize_uint32_t ok (MT?.i mtv) output sz pos in let h4 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h3 h4; let ok, pos = serialize_uint32_t ok (MT?.j mtv) output sz pos in let h5 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h4 h5; let ok, pos = serialize_hash_vv ok (MT?.hs mtv) output sz pos in let h6 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h5 h6; let ok, pos = serialize_bool ok (MT?.rhs_ok mtv) output sz pos in let h7 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h6 h7; let ok, pos = serialize_hash_vec ok (MT?.rhs mtv) output sz pos in let h8 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h7 h8; let ok, pos = serialize_hash ok (MT?.mroot mtv) output sz pos in let h9 = HST.get() in mt_safe_preserved mt (B.loc_buffer output) h8 h9; if ok then (FStar.Int.Cast.uint32_to_uint64 pos) else 0UL
val mt_serialize: mt:const_mt_p -> output:uint8_p -> sz:uint64_t -> HST.ST uint64_t (requires (fun h0 -> mt_safe h0 (CB.cast mt) /\ B.live h0 output /\ B.length output = U64.v sz /\ HS.disjoint (B.frameOf output) (B.frameOf (CB.cast mt)))) (ensures (fun h0 _ h1 -> mt_safe h1 (CB.cast mt) /\ modifies (B.loc_buffer output) h0 h1)) let mt_serialize mt output sz =
true
null
false
let mt = CB.cast mt in let sz = FStar.Int.Cast.uint64_to_uint32 sz in let mtv = !*mt in let h0 = HST.get () in let ok, pos = serialize_uint8_t true 1uy output sz 0ul in let h1 = HST.get () in mt_safe_preserved mt (B.loc_buffer output) h0 h1; let ok, pos = serialize_uint32_t ok (MT?.hash_size mtv) output sz pos in let h2 = HST.get () in mt_safe_preserved mt (B.loc_buffer output) h1 h2; let ok, pos = serialize_offset_t ok (MT?.offset mtv) output sz pos in let h3 = HST.get () in mt_safe_preserved mt (B.loc_buffer output) h2 h3; let ok, pos = serialize_uint32_t ok (MT?.i mtv) output sz pos in let h4 = HST.get () in mt_safe_preserved mt (B.loc_buffer output) h3 h4; let ok, pos = serialize_uint32_t ok (MT?.j mtv) output sz pos in let h5 = HST.get () in mt_safe_preserved mt (B.loc_buffer output) h4 h5; let ok, pos = serialize_hash_vv ok (MT?.hs mtv) output sz pos in let h6 = HST.get () in mt_safe_preserved mt (B.loc_buffer output) h5 h6; let ok, pos = serialize_bool ok (MT?.rhs_ok mtv) output sz pos in let h7 = HST.get () in mt_safe_preserved mt (B.loc_buffer output) h6 h7; let ok, pos = serialize_hash_vec ok (MT?.rhs mtv) output sz pos in let h8 = HST.get () in mt_safe_preserved mt (B.loc_buffer output) h7 h8; let ok, pos = serialize_hash ok (MT?.mroot mtv) output sz pos in let h9 = HST.get () in mt_safe_preserved mt (B.loc_buffer output) h8 h9; if ok then (FStar.Int.Cast.uint32_to_uint64 pos) else 0uL
{ "checked_file": "MerkleTree.Low.Serialization.fst.checked", "dependencies": [ "prims.fst.checked", "MerkleTree.Spec.fst.checked", "MerkleTree.Low.Hashfunctions.fst.checked", "MerkleTree.Low.Datastructures.fst.checked", "MerkleTree.Low.fst.checked", "LowStar.Vector.fst.checked", "LowStar.RVector.fst.checked", "LowStar.Regional.Instances.fst.checked", "LowStar.Regional.fst.checked", "LowStar.Modifies.fst.checked", "LowStar.ConstBuffer.fsti.checked", "LowStar.BufferOps.fst.checked", "LowStar.Buffer.fst.checked", "Lib.RawIntTypes.fsti.checked", "Lib.RawBuffer.fsti.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt16.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Monotonic.HyperHeap.fsti.checked", "FStar.Integers.fst.checked", "FStar.Int.Cast.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "MerkleTree.Low.Serialization.fst" }
[]
[ "MerkleTree.Low.const_mt_p", "MerkleTree.Low.Serialization.uint8_p", "MerkleTree.Low.Serialization.uint64_t", "Prims.bool", "MerkleTree.Low.Serialization.uint32_t", "FStar.Int.Cast.uint32_to_uint64", "FStar.UInt64.__uint_to_t", "Prims.unit", "MerkleTree.Low.mt_safe_preserved", "LowStar.Monotonic.Buffer.loc_buffer", "MerkleTree.Low.Serialization.uint8_t", "LowStar.Buffer.trivial_preorder", "FStar.Monotonic.HyperStack.mem", "FStar.HyperStack.ST.get", "FStar.Pervasives.Native.tuple2", "MerkleTree.Low.Serialization.serialize_hash", "MerkleTree.Low.__proj__MT__item__hash_size", "MerkleTree.Low.__proj__MT__item__mroot", "MerkleTree.Low.Serialization.serialize_hash_vec", "MerkleTree.Low.__proj__MT__item__rhs", "MerkleTree.Low.Serialization.serialize_bool", "MerkleTree.Low.__proj__MT__item__rhs_ok", "MerkleTree.Low.Serialization.serialize_hash_vv", "MerkleTree.Low.__proj__MT__item__hs", "MerkleTree.Low.Serialization.serialize_uint32_t", "MerkleTree.Low.__proj__MT__item__j", "MerkleTree.Low.__proj__MT__item__i", "MerkleTree.Low.Serialization.serialize_offset_t", "MerkleTree.Low.__proj__MT__item__offset", "MerkleTree.Low.Serialization.serialize_uint8_t", "FStar.UInt8.__uint_to_t", "FStar.UInt32.__uint_to_t", "MerkleTree.Low.merkle_tree", "LowStar.BufferOps.op_Bang_Star", "LowStar.ConstBuffer.qbuf_pre", "LowStar.ConstBuffer.as_qbuf", "FStar.UInt32.t", "Prims.b2t", "Prims.op_Equality", "Prims.int", "FStar.UInt32.v", "Prims.op_Modulus", "FStar.UInt64.v", "Prims.pow2", "FStar.Int.Cast.uint64_to_uint32", "LowStar.Monotonic.Buffer.mbuffer", "LowStar.ConstBuffer.cast" ]
[]
module MerkleTree.Low.Serialization open FStar.Integers open FStar.Mul open LowStar.Modifies open LowStar.BufferOps open LowStar.Vector open LowStar.RVector open LowStar.Regional open LowStar.Regional.Instances open MerkleTree.Low module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module HH = FStar.Monotonic.HyperHeap module B = LowStar.Buffer module CB = LowStar.ConstBuffer module V = LowStar.Vector module RV = LowStar.RVector module RVI = LowStar.Regional.Instances module U16 = FStar.UInt16 module U32 = FStar.UInt32 module U64 = FStar.UInt64 module U8 = FStar.UInt8 open MerkleTree.Low.Datastructures open MerkleTree.Low.Hashfunctions module MTS = MerkleTree.Spec let uint8_t = U8.t let uint16_t = U16.t let uint32_t = U32.t let uint64_t = U64.t let uint8_p = B.buffer uint8_t type const_uint8_p = const_pointer uint8_t #reset-options "--z3rlimit 5 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0" private let serialize_bool (ok:bool) (x:bool) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos (if x then 1uy else 0uy); (true, pos + 1ul) end private let serialize_uint8_t (ok:bool) (x:uint8_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin B.upd buf pos x; (true, pos + 1ul) end private let serialize_uint16_t (ok:bool) (x:uint16_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint8_t ok (Int.Cast.uint16_to_uint8 (U16.shift_right x 8ul)) buf sz pos in serialize_uint8_t ok (Int.Cast.uint16_to_uint8 x) buf sz pos private let serialize_uint32_t (ok:bool) (x:uint32_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint16_t ok (Int.Cast.uint32_to_uint16 (U32.shift_right x 16ul)) buf sz pos in serialize_uint16_t ok (Int.Cast.uint32_to_uint16 x) buf sz pos private let serialize_uint64_t (ok:bool) (x:uint64_t) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = let ok, pos = serialize_uint32_t ok (Int.Cast.uint64_to_uint32 (U64.shift_right x 32ul)) buf sz pos in serialize_uint32_t ok (Int.Cast.uint64_to_uint32 x) buf sz pos private let serialize_offset_t = serialize_uint64_t private let serialize_index_t = serialize_uint32_t private let rec serialize_hash_i (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < hash_size}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else let b = x.(i) in let ok, pos = serialize_uint8_t ok (Lib.RawIntTypes.u8_to_UInt8 b) buf sz pos in let j = i + 1ul in if j < hash_size then serialize_hash_i #hash_size ok x buf sz pos j else (ok, pos) private let serialize_hash (#hash_size:hash_size_t) (ok:bool) (x:hash #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ B.live h0 x /\ B.len x = hash_size)) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else serialize_hash_i ok x buf sz pos 0ul private inline_for_extraction let u64_add_fits (x:uint64_t) (y:uint64_t): Tot (r:bool{r ==> UInt.size (U64.v x + U64.v y) 64}) = uint64_max - x >= y #push-options "--z3rlimit 100 --fuel 1 --quake 1/3" private inline_for_extraction let hash_vec_bytes (#hash_size:hash_size_t) (v:hash_vec #hash_size) : Tot uint64_t = let vs_hs = U64.mul (u32_64 (V.size_of v)) (u32_64 hash_size) in if u64_add_fits vs_hs 4UL then vs_hs + 4UL else uint64_max #pop-options private let rec serialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ loc_disjoint (B.loc_buffer buf) (loc_rvector x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let ok, pos = serialize_hash ok vi buf sz pos in let j = i + 1ul in if j < V.size_of x then serialize_hash_vec_i ok x buf sz pos j else (ok, pos) end private let serialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (x:hash_vec #hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvreg hash_size) x))) (ensures (fun h0 _ h1 -> RV.rv_inv h1 x /\ modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if ok && V.size_of x > 0ul then serialize_hash_vec_i ok x buf sz pos 0ul else (ok, pos) end private inline_for_extraction let rec hash_vv_bytes_i (#hash_size:hash_size_t) (vv:hash_vv hash_size) (i:uint32_t) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = if i >= V.size_of vv then 4UL else begin let vvi = V.index vv i in let r = hash_vec_bytes vvi in let rest = hash_vv_bytes_i vv (i+1ul) in if u64_add_fits r rest then begin assert (UInt.size (U64.v r + U64.v rest) 64); r + rest end else uint64_max end private inline_for_extraction let hash_vv_bytes (#hash_size:hash_size_t) (vv:hash_vv hash_size {V.size_of vv = merkle_tree_size_lg}) : HST.ST uint64_t (requires (fun h0 -> V.live h0 vv)) (ensures (fun h0 _ h1 -> h0 == h1)) = hash_vv_bytes_i vv 0ul private let rec serialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) (i:uint32_t{i < V.size_of x}) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let vi = V.index x i in let h0 = HST.get() in let ok, pos = serialize_hash_vec #hash_size ok vi buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; let j = i + 1ul in if j < V.size_of x then serialize_hash_vv_i #hash_size ok x buf sz pos j else (ok, pos) end private let serialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (x:hash_vv hash_size) (buf:uint8_p) (sz:uint32_t{B.len buf = sz}) (pos:uint32_t) : HST.ST (bool & uint32_t) (requires (fun h0 -> B.live h0 buf /\ RV.rv_inv h0 x /\ HS.disjoint (B.frameOf buf) (Rgl?.region_of (hvvreg hash_size) x))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer buf) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let h0 = HST.get() in let ok, pos = serialize_uint32_t ok (V.size_of x) buf sz pos in let h1 = HST.get() in RV.rv_inv_preserved x (B.loc_buffer buf) h0 h1; if (V.size_of x > 0ul) then serialize_hash_vv_i ok x buf sz pos 0ul else (ok, pos) end private let deserialize_bool (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & bool) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, false) else (true, pos + 1ul, (match CB.index buf pos with| 0uy -> false | _ -> true)) private let deserialize_uint8_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint8_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0uy) else (true, pos + 1ul, CB.index buf pos) private let deserialize_uint16_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint16_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0us) else begin let ok, pos, b0 = deserialize_uint8_t ok buf sz pos in let ok, pos, b1 = deserialize_uint8_t ok buf sz pos in (ok, pos, (U16.shift_left (Int.Cast.uint8_to_uint16 b0) 8ul) + Int.Cast.uint8_to_uint16 b1) end private let deserialize_uint32_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint32_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0ul) else begin let ok, pos, b0 = deserialize_uint16_t ok buf sz pos in let ok, pos, b1 = deserialize_uint16_t ok buf sz pos in (ok, pos, (U32.shift_left (Int.Cast.uint16_to_uint32 b0) 16ul) + Int.Cast.uint16_to_uint32 b1) end private let deserialize_uint64_t (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (pos:uint32_t): HST.ST (bool & uint32_t & uint64_t) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> h0 == h1)) = if not ok || pos >= sz then (false, pos, 0UL) else begin let ok, pos, b0 = deserialize_uint32_t ok buf sz pos in let ok, pos, b1 = deserialize_uint32_t ok buf sz pos in (ok, pos, (U64.shift_left (u32_64 b0) 32ul) + u32_64 b1) end private let deserialize_offset_t = deserialize_uint64_t private let deserialize_index_t = deserialize_uint32_t private let deserialize_hash (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 (k, _, h) h1 -> (k ==> Rgl?.r_inv (hreg hash_size) h1 h) /\ loc_disjoint (loc_buffer (CB.cast buf)) (loc_buffer h) /\ modifies B.loc_none h0 h1)) = let rg = hreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else if sz - pos < hash_size then (false, pos, rg_dummy rg) else begin let hash = rg_alloc rg r in Lib.RawBuffer.blit (CB.cast buf) pos hash 0ul hash_size; (true, pos + hash_size, hash) end private let rec deserialize_hash_vec_i (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) (res:hash_vec #hash_size) (i:uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res)) (ensures (fun h0 _ h1 -> B.modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) = if not ok || pos >= sz then (false, pos) else begin let ok, pos, h = deserialize_hash ok buf sz r pos in if not ok then (false, pos) else begin V.assign res i h; (* * AR: 04/01: The call deserialize_hash_vec_i below needs liveness of buf * So we have to frame buf liveness for the V.assign call * V.assign provides a modifies postcondition in terms of * loc_vector_within, which is a recursive predicate and * I guess hard to reason about directly * Whereas to reason about liveness of buf, we only need an * overapproximation that V.assign modifies V.Vec?.vs res * Looking at the Vector library, I found the following lemma * that does the trick *) V.loc_vector_within_included res i (i + 1ul); let j = i + 1ul in if j < V.size_of res then deserialize_hash_vec_i ok buf sz r pos res j else (true, pos) end end private let deserialize_hash_vec (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash_vec #hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> B.modifies B.loc_none h0 h1)) = let rg = hvreg hash_size in if not ok || pos >= sz then (false, pos, rg_dummy rg) else begin let ok, pos, n = deserialize_uint32_t ok buf sz pos in if not ok then (false, pos, V.alloc_empty hash) else if n = 0ul then (true, pos, V.alloc_empty hash) else begin let hrg = hreg hash_size in let res = V.alloc n (rg_dummy hrg) in let ok, pos = deserialize_hash_vec_i ok buf sz r pos res 0ul in (ok, pos, res) end end private let rec deserialize_hash_vv_i (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) (res:hash_vv hash_size) (i:uint32_t{i < V.size_of res}) : HST.ST (bool & uint32_t) (requires (fun h0 -> CB.live h0 buf /\ V.live h0 res /\ B.loc_disjoint (CB.loc_buffer buf) (V.loc_vector res))) (ensures (fun h0 _ h1 -> modifies (B.loc_buffer (V.Vec?.vs res)) h0 h1)) = if not ok || pos >= sz then (false, 0ul) else begin let ok, pos, hv = deserialize_hash_vec ok buf sz r pos in let h0 = HST.get() in if not ok then (false, pos) else begin V.assign res i hv; (* * AR: 04/01: The call deserialize_hash_vv_i below needs liveness of buf * So we have to frame buf liveness for the V.assign call * V.assign provides a modifies postcondition in terms of * loc_vector_within, which is a recursive predicate and * I guess hard to reason about directly * Whereas to reason about liveness of buf, we only need an * overapproximation that V.assign modifies V.Vec?.vs res * Looking at the Vector library, I found the following lemma * that does the trick *) V.loc_vector_within_included res i (i + 1ul); let j = i + 1ul in if j = V.size_of res then (true, pos) else deserialize_hash_vv_i ok buf sz r pos res j end end private let deserialize_hash_vv (#hash_size:hash_size_t) (ok:bool) (buf:const_uint8_p) (sz:uint32_t{CB.length buf = U32.v sz}) (r:HST.erid) (pos:uint32_t) : HST.ST (bool & uint32_t & hash_vv hash_size) (requires (fun h0 -> CB.live h0 buf)) (ensures (fun h0 _ h1 -> modifies B.loc_none h0 h1)) = if not ok || pos >= sz then (false, pos, V.alloc_empty hash_vec) else begin let ok, pos, n = deserialize_uint32_t ok buf sz pos in if not ok then (false, pos, V.alloc_empty hash_vec) else if n = 0ul then (true, pos, V.alloc_empty hash_vec) else begin let rg = hvreg hash_size in let res = V.alloc n (rg_dummy rg) in let ok, pos = deserialize_hash_vv_i ok buf sz r pos res 0ul in (ok, pos, res) end end #push-options "--z3rlimit 10" val mt_serialize_size: mt:const_mt_p -> HST.ST uint64_t (requires (fun h0 -> mt_safe h0 (CB.cast mt))) (ensures (fun _ _ h1 -> mt_safe h1 (CB.cast mt))) let mt_serialize_size mt = let mtv = !*(CB.cast mt) in let hs = MT?.hs mtv in let rhs_ok = MT?.rhs_ok mtv in let rhs = MT?.rhs mtv in let hs_sz = hash_vv_bytes hs in if hs_sz < uint32_max then 1UL + // format version 4UL + // hash_size 8UL + // offset 4UL + 4UL + // i, j hs_sz + // hs 1UL + // rhs_ok hash_vec_bytes rhs + // rhs u32_64 (MT?.hash_size mtv) // mroot else uint64_max #pop-options #push-options "--z3rlimit 15 --initial_fuel 1 --max_fuel 1" val mt_serialize: mt:const_mt_p -> output:uint8_p -> sz:uint64_t -> HST.ST uint64_t (requires (fun h0 -> mt_safe h0 (CB.cast mt) /\ B.live h0 output /\ B.length output = U64.v sz /\ HS.disjoint (B.frameOf output) (B.frameOf (CB.cast mt))))
false
false
MerkleTree.Low.Serialization.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 1, "initial_ifuel": 0, "max_fuel": 1, "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": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 15, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val mt_serialize: mt:const_mt_p -> output:uint8_p -> sz:uint64_t -> HST.ST uint64_t (requires (fun h0 -> mt_safe h0 (CB.cast mt) /\ B.live h0 output /\ B.length output = U64.v sz /\ HS.disjoint (B.frameOf output) (B.frameOf (CB.cast mt)))) (ensures (fun h0 _ h1 -> mt_safe h1 (CB.cast mt) /\ modifies (B.loc_buffer output) h0 h1))
[]
MerkleTree.Low.Serialization.mt_serialize
{ "file_name": "src/MerkleTree.Low.Serialization.fst", "git_rev": "3b0f086655c145aa23f58a97259ebf4cf112a4a3", "git_url": "https://github.com/hacl-star/merkle-tree.git", "project_name": "merkle-tree" }
mt: MerkleTree.Low.const_mt_p -> output: MerkleTree.Low.Serialization.uint8_p -> sz: MerkleTree.Low.Serialization.uint64_t -> FStar.HyperStack.ST.ST MerkleTree.Low.Serialization.uint64_t
{ "end_col": 59, "end_line": 442, "start_col": 31, "start_line": 419 }
Prims.Tot
[ { "abbrev": false, "full_module": "Pulse.Checker.Prover.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": true, "full_module": "Pulse.Typing.Metatheory", "short_module": "Metatheory" }, { "abbrev": false, "full_module": "Pulse.Typing.Combinators", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.VPropEquiv", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker.Prover.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let elim_pure_head = let elim_pure_explicit_lid = mk_pulse_lib_core_lid "elim_pure_explicit" in tm_fvar (as_fv elim_pure_explicit_lid)
let elim_pure_head =
false
null
false
let elim_pure_explicit_lid = mk_pulse_lib_core_lid "elim_pure_explicit" in tm_fvar (as_fv elim_pure_explicit_lid)
{ "checked_file": "Pulse.Checker.Prover.ElimPure.fst.checked", "dependencies": [ "Pulse.Typing.Metatheory.fsti.checked", "Pulse.Typing.Combinators.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.Checker.VPropEquiv.fsti.checked", "Pulse.Checker.Pure.fsti.checked", "Pulse.Checker.Prover.Base.fsti.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Range.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Prover.ElimPure.fst" }
[ "total" ]
[ "Pulse.Syntax.Pure.tm_fvar", "Pulse.Syntax.Base.as_fv", "Prims.list", "Prims.string", "Pulse.Reflection.Util.mk_pulse_lib_core_lid" ]
[]
module Pulse.Checker.Prover.ElimPure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.List.Tot open Pulse.Syntax open Pulse.Checker.Pure open Pulse.Checker.VPropEquiv open Pulse.Typing open Pulse.Typing.Combinators module Metatheory = Pulse.Typing.Metatheory open Pulse.Reflection.Util open Pulse.Checker.Prover.Base
false
true
Pulse.Checker.Prover.ElimPure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val elim_pure_head : Pulse.Syntax.Base.term
[]
Pulse.Checker.Prover.ElimPure.elim_pure_head
{ "file_name": "lib/steel/pulse/Pulse.Checker.Prover.ElimPure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
Pulse.Syntax.Base.term
{ "end_col": 42, "end_line": 20, "start_col": 20, "start_line": 18 }
Prims.Tot
[ { "abbrev": false, "full_module": "Pulse.Checker.Prover.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": true, "full_module": "Pulse.Typing.Metatheory", "short_module": "Metatheory" }, { "abbrev": false, "full_module": "Pulse.Typing.Combinators", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.VPropEquiv", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker.Prover.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let elim_pure_head_ty = // let open Pulse.Steel.Wrapper in // let open Steel.Effect.Common in let squash_p = mk_squash u0 (RT.bound_var 0) in let pure_p = mk_pure (RT.bound_var 0) in let post = mk_abs squash_p R.Q_Explicit (R.pack_ln (R.Tv_FVar (R.pack_fv emp_lid))) in let cod = mk_stt_ghost_comp u0 squash_p emp_inames_tm pure_p post in mk_arrow (R.pack_ln (R.Tv_FVar (R.pack_fv R.prop_qn)), R.Q_Explicit) cod
let elim_pure_head_ty =
false
null
false
let squash_p = mk_squash u0 (RT.bound_var 0) in let pure_p = mk_pure (RT.bound_var 0) in let post = mk_abs squash_p R.Q_Explicit (R.pack_ln (R.Tv_FVar (R.pack_fv emp_lid))) in let cod = mk_stt_ghost_comp u0 squash_p emp_inames_tm pure_p post in mk_arrow (R.pack_ln (R.Tv_FVar (R.pack_fv R.prop_qn)), R.Q_Explicit) cod
{ "checked_file": "Pulse.Checker.Prover.ElimPure.fst.checked", "dependencies": [ "Pulse.Typing.Metatheory.fsti.checked", "Pulse.Typing.Combinators.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.Checker.VPropEquiv.fsti.checked", "Pulse.Checker.Pure.fsti.checked", "Pulse.Checker.Prover.Base.fsti.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Range.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Prover.ElimPure.fst" }
[ "total" ]
[ "Pulse.Reflection.Util.mk_arrow", "FStar.Pervasives.Native.Mktuple2", "FStar.Reflection.Types.term", "FStar.Reflection.V2.Data.aqualv", "FStar.Reflection.V2.Builtins.pack_ln", "FStar.Reflection.V2.Data.Tv_FVar", "FStar.Reflection.V2.Builtins.pack_fv", "FStar.Reflection.Const.prop_qn", "FStar.Reflection.V2.Data.Q_Explicit", "Pulse.Reflection.Util.mk_stt_ghost_comp", "Pulse.Syntax.Pure.u0", "Pulse.Reflection.Util.emp_inames_tm", "Pulse.Reflection.Util.mk_abs", "Pulse.Reflection.Util.emp_lid", "Pulse.Reflection.Util.mk_pure", "FStar.Reflection.Typing.bound_var", "Pulse.Reflection.Util.mk_squash" ]
[]
module Pulse.Checker.Prover.ElimPure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.List.Tot open Pulse.Syntax open Pulse.Checker.Pure open Pulse.Checker.VPropEquiv open Pulse.Typing open Pulse.Typing.Combinators module Metatheory = Pulse.Typing.Metatheory open Pulse.Reflection.Util open Pulse.Checker.Prover.Base let elim_pure_head = let elim_pure_explicit_lid = mk_pulse_lib_core_lid "elim_pure_explicit" in tm_fvar (as_fv elim_pure_explicit_lid)
false
true
Pulse.Checker.Prover.ElimPure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val elim_pure_head_ty : FStar.Reflection.Types.term
[]
Pulse.Checker.Prover.ElimPure.elim_pure_head_ty
{ "file_name": "lib/steel/pulse/Pulse.Checker.Prover.ElimPure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
FStar.Reflection.Types.term
{ "end_col": 9, "end_line": 33, "start_col": 23, "start_line": 22 }
Prims.Tot
val mk_elim_pure (p: term) : st_term
[ { "abbrev": false, "full_module": "Pulse.Checker.Prover.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": true, "full_module": "Pulse.Typing.Metatheory", "short_module": "Metatheory" }, { "abbrev": false, "full_module": "Pulse.Typing.Combinators", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.VPropEquiv", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker.Prover.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let mk_elim_pure (p:term) : st_term = let t = Tm_STApp { head = elim_pure_head; arg_qual = None; arg = p } in wtag (Some STT_Ghost) t
val mk_elim_pure (p: term) : st_term let mk_elim_pure (p: term) : st_term =
false
null
false
let t = Tm_STApp ({ head = elim_pure_head; arg_qual = None; arg = p }) in wtag (Some STT_Ghost) t
{ "checked_file": "Pulse.Checker.Prover.ElimPure.fst.checked", "dependencies": [ "Pulse.Typing.Metatheory.fsti.checked", "Pulse.Typing.Combinators.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.Checker.VPropEquiv.fsti.checked", "Pulse.Checker.Pure.fsti.checked", "Pulse.Checker.Prover.Base.fsti.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Range.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Prover.ElimPure.fst" }
[ "total" ]
[ "Pulse.Syntax.Base.term", "Pulse.Typing.wtag", "FStar.Pervasives.Native.Some", "Pulse.Syntax.Base.ctag", "Pulse.Syntax.Base.STT_Ghost", "Pulse.Syntax.Base.st_term'", "Pulse.Syntax.Base.Tm_STApp", "Pulse.Syntax.Base.Mkst_term'__Tm_STApp__payload", "Pulse.Checker.Prover.ElimPure.elim_pure_head", "FStar.Pervasives.Native.None", "Pulse.Syntax.Base.qualifier", "Pulse.Syntax.Base.st_term" ]
[]
module Pulse.Checker.Prover.ElimPure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.List.Tot open Pulse.Syntax open Pulse.Checker.Pure open Pulse.Checker.VPropEquiv open Pulse.Typing open Pulse.Typing.Combinators module Metatheory = Pulse.Typing.Metatheory open Pulse.Reflection.Util open Pulse.Checker.Prover.Base let elim_pure_head = let elim_pure_explicit_lid = mk_pulse_lib_core_lid "elim_pure_explicit" in tm_fvar (as_fv elim_pure_explicit_lid) let elim_pure_head_ty = // let open Pulse.Steel.Wrapper in // let open Steel.Effect.Common in let squash_p = mk_squash u0 (RT.bound_var 0) in let pure_p = mk_pure (RT.bound_var 0) in let post = mk_abs squash_p R.Q_Explicit (R.pack_ln (R.Tv_FVar (R.pack_fv emp_lid))) in let cod = mk_stt_ghost_comp u0 squash_p emp_inames_tm pure_p post in mk_arrow (R.pack_ln (R.Tv_FVar (R.pack_fv R.prop_qn)), R.Q_Explicit) cod // Following crashes in extraction // `(p:prop -> stt_ghost (squash p) emp_inames // (pure p) // (fun _ -> emp)) let tm_fstar t = tm_fstar t Range.range_0 let elim_pure_head_typing (g:env) : tot_typing g elim_pure_head (tm_fstar elim_pure_head_ty) = admit() let mk_elim_pure (p:term)
false
true
Pulse.Checker.Prover.ElimPure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val mk_elim_pure (p: term) : st_term
[]
Pulse.Checker.Prover.ElimPure.mk_elim_pure
{ "file_name": "lib/steel/pulse/Pulse.Checker.Prover.ElimPure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
p: Pulse.Syntax.Base.term -> Pulse.Syntax.Base.st_term
{ "end_col": 27, "end_line": 51, "start_col": 3, "start_line": 47 }
FStar.Tactics.Effect.Tac
val is_elim_pure (vp: term) : T.Tac bool
[ { "abbrev": false, "full_module": "Pulse.Checker.Prover.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": true, "full_module": "Pulse.Typing.Metatheory", "short_module": "Metatheory" }, { "abbrev": false, "full_module": "Pulse.Typing.Combinators", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.VPropEquiv", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker.Prover.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let is_elim_pure (vp:term) : T.Tac bool = match vp.t with | Tm_Pure {t=Tm_FStar _} -> true | _ -> false
val is_elim_pure (vp: term) : T.Tac bool let is_elim_pure (vp: term) : T.Tac bool =
true
null
false
match vp.t with | Tm_Pure { t = Tm_FStar _ } -> true | _ -> false
{ "checked_file": "Pulse.Checker.Prover.ElimPure.fst.checked", "dependencies": [ "Pulse.Typing.Metatheory.fsti.checked", "Pulse.Typing.Combinators.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.Checker.VPropEquiv.fsti.checked", "Pulse.Checker.Pure.fsti.checked", "Pulse.Checker.Prover.Base.fsti.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Range.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Prover.ElimPure.fst" }
[]
[ "Pulse.Syntax.Base.term", "Pulse.Syntax.Base.__proj__Mkterm__item__t", "Pulse.Syntax.Base.host_term", "Pulse.Syntax.Base.range", "Pulse.Syntax.Base.term'", "Prims.bool" ]
[]
module Pulse.Checker.Prover.ElimPure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.List.Tot open Pulse.Syntax open Pulse.Checker.Pure open Pulse.Checker.VPropEquiv open Pulse.Typing open Pulse.Typing.Combinators module Metatheory = Pulse.Typing.Metatheory open Pulse.Reflection.Util open Pulse.Checker.Prover.Base let elim_pure_head = let elim_pure_explicit_lid = mk_pulse_lib_core_lid "elim_pure_explicit" in tm_fvar (as_fv elim_pure_explicit_lid) let elim_pure_head_ty = // let open Pulse.Steel.Wrapper in // let open Steel.Effect.Common in let squash_p = mk_squash u0 (RT.bound_var 0) in let pure_p = mk_pure (RT.bound_var 0) in let post = mk_abs squash_p R.Q_Explicit (R.pack_ln (R.Tv_FVar (R.pack_fv emp_lid))) in let cod = mk_stt_ghost_comp u0 squash_p emp_inames_tm pure_p post in mk_arrow (R.pack_ln (R.Tv_FVar (R.pack_fv R.prop_qn)), R.Q_Explicit) cod // Following crashes in extraction // `(p:prop -> stt_ghost (squash p) emp_inames // (pure p) // (fun _ -> emp)) let tm_fstar t = tm_fstar t Range.range_0 let elim_pure_head_typing (g:env) : tot_typing g elim_pure_head (tm_fstar elim_pure_head_ty) = admit() let mk_elim_pure (p:term) : st_term = let t = Tm_STApp { head = elim_pure_head; arg_qual = None; arg = p } in wtag (Some STT_Ghost) t let elim_pure_comp (p:host_term) = let st : st_comp = { u=u_zero; res=tm_fstar (mk_squash u0 p); pre=tm_pure (tm_fstar p); post=tm_emp } in C_STGhost tm_emp_inames st #push-options "--admit_smt_queries true" let elim_pure_typing (g:env) (p:host_term) (p_prop:tot_typing g (tm_fstar p) (tm_fstar RT.tm_prop)) : st_typing g (mk_elim_pure (tm_fstar p)) (elim_pure_comp p) = T_STApp g elim_pure_head (tm_fstar RT.tm_prop) None (elim_pure_comp p) _ (elim_pure_head_typing g) p_prop #pop-options
false
false
Pulse.Checker.Prover.ElimPure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val is_elim_pure (vp: term) : T.Tac bool
[]
Pulse.Checker.Prover.ElimPure.is_elim_pure
{ "file_name": "lib/steel/pulse/Pulse.Checker.Prover.ElimPure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
vp: Pulse.Syntax.Base.term -> FStar.Tactics.Effect.Tac Prims.bool
{ "end_col": 14, "end_line": 73, "start_col": 2, "start_line": 71 }
FStar.Tactics.Effect.Tac
val elim_pure_frame (#g: env) (#ctxt #frame: term) (ctxt_frame_typing: tot_typing g (ctxt * frame) tm_vprop) (uvs: env{disjoint uvs g}) : T.Tac (g': env{env_extends g' g /\ disjoint uvs g'} & ctxt': term & tot_typing g' (ctxt' * frame) tm_vprop & continuation_elaborator g (ctxt * frame) g' (ctxt' * frame))
[ { "abbrev": false, "full_module": "Pulse.Checker.Prover.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": true, "full_module": "Pulse.Typing.Metatheory", "short_module": "Metatheory" }, { "abbrev": false, "full_module": "Pulse.Typing.Combinators", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.VPropEquiv", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker.Prover.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let elim_pure_frame (#g:env) (#ctxt:term) (#frame:term) (ctxt_frame_typing:tot_typing g (ctxt * frame) tm_vprop) (uvs:env { disjoint uvs g }) : T.Tac (g':env { env_extends g' g /\ disjoint uvs g' } & ctxt':term & tot_typing g' (ctxt' * frame) tm_vprop & continuation_elaborator g (ctxt * frame) g' (ctxt' * frame)) = add_elims is_elim_pure mk ctxt_frame_typing uvs
val elim_pure_frame (#g: env) (#ctxt #frame: term) (ctxt_frame_typing: tot_typing g (ctxt * frame) tm_vprop) (uvs: env{disjoint uvs g}) : T.Tac (g': env{env_extends g' g /\ disjoint uvs g'} & ctxt': term & tot_typing g' (ctxt' * frame) tm_vprop & continuation_elaborator g (ctxt * frame) g' (ctxt' * frame)) let elim_pure_frame (#g: env) (#ctxt #frame: term) (ctxt_frame_typing: tot_typing g (ctxt * frame) tm_vprop) (uvs: env{disjoint uvs g}) : T.Tac (g': env{env_extends g' g /\ disjoint uvs g'} & ctxt': term & tot_typing g' (ctxt' * frame) tm_vprop & continuation_elaborator g (ctxt * frame) g' (ctxt' * frame)) =
true
null
false
add_elims is_elim_pure mk ctxt_frame_typing uvs
{ "checked_file": "Pulse.Checker.Prover.ElimPure.fst.checked", "dependencies": [ "Pulse.Typing.Metatheory.fsti.checked", "Pulse.Typing.Combinators.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.Checker.VPropEquiv.fsti.checked", "Pulse.Checker.Pure.fsti.checked", "Pulse.Checker.Prover.Base.fsti.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Range.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Prover.ElimPure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "Pulse.Typing.tot_typing", "Pulse.Checker.Prover.Base.op_Star", "Pulse.Syntax.Base.tm_vprop", "Pulse.Typing.Env.disjoint", "Pulse.Checker.Prover.Base.add_elims", "Pulse.Checker.Prover.ElimPure.is_elim_pure", "Pulse.Checker.Prover.ElimPure.mk", "FStar.Pervasives.dtuple4", "Prims.l_and", "Pulse.Typing.Env.env_extends", "Pulse.Syntax.Base.tm_star", "Pulse.Checker.Base.continuation_elaborator" ]
[]
module Pulse.Checker.Prover.ElimPure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.List.Tot open Pulse.Syntax open Pulse.Checker.Pure open Pulse.Checker.VPropEquiv open Pulse.Typing open Pulse.Typing.Combinators module Metatheory = Pulse.Typing.Metatheory open Pulse.Reflection.Util open Pulse.Checker.Prover.Base let elim_pure_head = let elim_pure_explicit_lid = mk_pulse_lib_core_lid "elim_pure_explicit" in tm_fvar (as_fv elim_pure_explicit_lid) let elim_pure_head_ty = // let open Pulse.Steel.Wrapper in // let open Steel.Effect.Common in let squash_p = mk_squash u0 (RT.bound_var 0) in let pure_p = mk_pure (RT.bound_var 0) in let post = mk_abs squash_p R.Q_Explicit (R.pack_ln (R.Tv_FVar (R.pack_fv emp_lid))) in let cod = mk_stt_ghost_comp u0 squash_p emp_inames_tm pure_p post in mk_arrow (R.pack_ln (R.Tv_FVar (R.pack_fv R.prop_qn)), R.Q_Explicit) cod // Following crashes in extraction // `(p:prop -> stt_ghost (squash p) emp_inames // (pure p) // (fun _ -> emp)) let tm_fstar t = tm_fstar t Range.range_0 let elim_pure_head_typing (g:env) : tot_typing g elim_pure_head (tm_fstar elim_pure_head_ty) = admit() let mk_elim_pure (p:term) : st_term = let t = Tm_STApp { head = elim_pure_head; arg_qual = None; arg = p } in wtag (Some STT_Ghost) t let elim_pure_comp (p:host_term) = let st : st_comp = { u=u_zero; res=tm_fstar (mk_squash u0 p); pre=tm_pure (tm_fstar p); post=tm_emp } in C_STGhost tm_emp_inames st #push-options "--admit_smt_queries true" let elim_pure_typing (g:env) (p:host_term) (p_prop:tot_typing g (tm_fstar p) (tm_fstar RT.tm_prop)) : st_typing g (mk_elim_pure (tm_fstar p)) (elim_pure_comp p) = T_STApp g elim_pure_head (tm_fstar RT.tm_prop) None (elim_pure_comp p) _ (elim_pure_head_typing g) p_prop #pop-options let is_elim_pure (vp:term) : T.Tac bool = match vp.t with | Tm_Pure {t=Tm_FStar _} -> true | _ -> false let mk (#g:env) (#v:vprop) (v_typing:tot_typing g v tm_vprop) : T.Tac (option (x:ppname & t:st_term & c:comp { stateful_comp c /\ comp_pre c == v } & st_typing g t c)) = match v.t with | Tm_Pure {t=Tm_FStar pp} -> let p_typing = Metatheory.pure_typing_inversion #g #(tm_fstar pp) v_typing in Some (| ppname_default, mk_elim_pure (tm_fstar pp), elim_pure_comp pp, elim_pure_typing g pp p_typing |) | _ -> None let elim_pure_frame (#g:env) (#ctxt:term) (#frame:term) (ctxt_frame_typing:tot_typing g (ctxt * frame) tm_vprop) (uvs:env { disjoint uvs g }) : T.Tac (g':env { env_extends g' g /\ disjoint uvs g' } & ctxt':term & tot_typing g' (ctxt' * frame) tm_vprop &
false
false
Pulse.Checker.Prover.ElimPure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val elim_pure_frame (#g: env) (#ctxt #frame: term) (ctxt_frame_typing: tot_typing g (ctxt * frame) tm_vprop) (uvs: env{disjoint uvs g}) : T.Tac (g': env{env_extends g' g /\ disjoint uvs g'} & ctxt': term & tot_typing g' (ctxt' * frame) tm_vprop & continuation_elaborator g (ctxt * frame) g' (ctxt' * frame))
[]
Pulse.Checker.Prover.ElimPure.elim_pure_frame
{ "file_name": "lib/steel/pulse/Pulse.Checker.Prover.ElimPure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
ctxt_frame_typing: Pulse.Typing.tot_typing g (ctxt * frame) Pulse.Syntax.Base.tm_vprop -> uvs: Pulse.Typing.Env.env{Pulse.Typing.Env.disjoint uvs g} -> FStar.Tactics.Effect.Tac (FStar.Pervasives.dtuple4 (g': Pulse.Typing.Env.env {Pulse.Typing.Env.env_extends g' g /\ Pulse.Typing.Env.disjoint uvs g'}) (fun _ -> Pulse.Syntax.Base.term) (fun g' ctxt' -> Pulse.Typing.tot_typing g' (ctxt' * frame) Pulse.Syntax.Base.tm_vprop) (fun g' ctxt' _ -> Pulse.Checker.Base.continuation_elaborator g (ctxt * frame) g' (ctxt' * frame)))
{ "end_col": 49, "end_line": 97, "start_col": 2, "start_line": 97 }
Prims.Tot
[ { "abbrev": false, "full_module": "Pulse.Checker.Prover.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": true, "full_module": "Pulse.Typing.Metatheory", "short_module": "Metatheory" }, { "abbrev": false, "full_module": "Pulse.Typing.Combinators", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.VPropEquiv", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker.Prover.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let tm_fstar t = tm_fstar t Range.range_0
let tm_fstar t =
false
null
false
tm_fstar t Range.range_0
{ "checked_file": "Pulse.Checker.Prover.ElimPure.fst.checked", "dependencies": [ "Pulse.Typing.Metatheory.fsti.checked", "Pulse.Typing.Combinators.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.Checker.VPropEquiv.fsti.checked", "Pulse.Checker.Pure.fsti.checked", "Pulse.Checker.Prover.Base.fsti.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Range.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Prover.ElimPure.fst" }
[ "total" ]
[ "Pulse.Syntax.Base.host_term", "Pulse.Syntax.Base.tm_fstar", "FStar.Range.range_0", "Pulse.Syntax.Base.term" ]
[]
module Pulse.Checker.Prover.ElimPure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.List.Tot open Pulse.Syntax open Pulse.Checker.Pure open Pulse.Checker.VPropEquiv open Pulse.Typing open Pulse.Typing.Combinators module Metatheory = Pulse.Typing.Metatheory open Pulse.Reflection.Util open Pulse.Checker.Prover.Base let elim_pure_head = let elim_pure_explicit_lid = mk_pulse_lib_core_lid "elim_pure_explicit" in tm_fvar (as_fv elim_pure_explicit_lid) let elim_pure_head_ty = // let open Pulse.Steel.Wrapper in // let open Steel.Effect.Common in let squash_p = mk_squash u0 (RT.bound_var 0) in let pure_p = mk_pure (RT.bound_var 0) in let post = mk_abs squash_p R.Q_Explicit (R.pack_ln (R.Tv_FVar (R.pack_fv emp_lid))) in let cod = mk_stt_ghost_comp u0 squash_p emp_inames_tm pure_p post in mk_arrow (R.pack_ln (R.Tv_FVar (R.pack_fv R.prop_qn)), R.Q_Explicit) cod // Following crashes in extraction // `(p:prop -> stt_ghost (squash p) emp_inames // (pure p) // (fun _ -> emp))
false
true
Pulse.Checker.Prover.ElimPure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val tm_fstar : t: Pulse.Syntax.Base.host_term -> Pulse.Syntax.Base.term
[]
Pulse.Checker.Prover.ElimPure.tm_fstar
{ "file_name": "lib/steel/pulse/Pulse.Checker.Prover.ElimPure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
t: Pulse.Syntax.Base.host_term -> Pulse.Syntax.Base.term
{ "end_col": 41, "end_line": 39, "start_col": 17, "start_line": 39 }
Prims.Tot
[ { "abbrev": false, "full_module": "Pulse.Checker.Prover.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": true, "full_module": "Pulse.Typing.Metatheory", "short_module": "Metatheory" }, { "abbrev": false, "full_module": "Pulse.Typing.Combinators", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.VPropEquiv", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker.Prover.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let elim_pure_comp (p:host_term) = let st : st_comp = { u=u_zero; res=tm_fstar (mk_squash u0 p); pre=tm_pure (tm_fstar p); post=tm_emp } in C_STGhost tm_emp_inames st
let elim_pure_comp (p: host_term) =
false
null
false
let st:st_comp = { u = u_zero; res = tm_fstar (mk_squash u0 p); pre = tm_pure (tm_fstar p); post = tm_emp } in C_STGhost tm_emp_inames st
{ "checked_file": "Pulse.Checker.Prover.ElimPure.fst.checked", "dependencies": [ "Pulse.Typing.Metatheory.fsti.checked", "Pulse.Typing.Combinators.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.Checker.VPropEquiv.fsti.checked", "Pulse.Checker.Pure.fsti.checked", "Pulse.Checker.Prover.Base.fsti.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Range.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Prover.ElimPure.fst" }
[ "total" ]
[ "Pulse.Syntax.Base.host_term", "Pulse.Syntax.Base.C_STGhost", "Pulse.Syntax.Base.tm_emp_inames", "Pulse.Syntax.Base.st_comp", "Pulse.Syntax.Base.Mkst_comp", "Pulse.Syntax.Pure.u_zero", "Pulse.Checker.Prover.ElimPure.tm_fstar", "Pulse.Reflection.Util.mk_squash", "Pulse.Syntax.Pure.u0", "Pulse.Syntax.Base.tm_pure", "Pulse.Syntax.Base.tm_emp", "Pulse.Syntax.Base.comp" ]
[]
module Pulse.Checker.Prover.ElimPure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.List.Tot open Pulse.Syntax open Pulse.Checker.Pure open Pulse.Checker.VPropEquiv open Pulse.Typing open Pulse.Typing.Combinators module Metatheory = Pulse.Typing.Metatheory open Pulse.Reflection.Util open Pulse.Checker.Prover.Base let elim_pure_head = let elim_pure_explicit_lid = mk_pulse_lib_core_lid "elim_pure_explicit" in tm_fvar (as_fv elim_pure_explicit_lid) let elim_pure_head_ty = // let open Pulse.Steel.Wrapper in // let open Steel.Effect.Common in let squash_p = mk_squash u0 (RT.bound_var 0) in let pure_p = mk_pure (RT.bound_var 0) in let post = mk_abs squash_p R.Q_Explicit (R.pack_ln (R.Tv_FVar (R.pack_fv emp_lid))) in let cod = mk_stt_ghost_comp u0 squash_p emp_inames_tm pure_p post in mk_arrow (R.pack_ln (R.Tv_FVar (R.pack_fv R.prop_qn)), R.Q_Explicit) cod // Following crashes in extraction // `(p:prop -> stt_ghost (squash p) emp_inames // (pure p) // (fun _ -> emp)) let tm_fstar t = tm_fstar t Range.range_0 let elim_pure_head_typing (g:env) : tot_typing g elim_pure_head (tm_fstar elim_pure_head_ty) = admit() let mk_elim_pure (p:term) : st_term = let t = Tm_STApp { head = elim_pure_head; arg_qual = None; arg = p } in wtag (Some STT_Ghost) t
false
true
Pulse.Checker.Prover.ElimPure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val elim_pure_comp : p: Pulse.Syntax.Base.host_term -> Pulse.Syntax.Base.comp
[]
Pulse.Checker.Prover.ElimPure.elim_pure_comp
{ "file_name": "lib/steel/pulse/Pulse.Checker.Prover.ElimPure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
p: Pulse.Syntax.Base.host_term -> Pulse.Syntax.Base.comp
{ "end_col": 30, "end_line": 61, "start_col": 34, "start_line": 54 }
FStar.Tactics.Effect.Tac
val mk (#g: env) (#v: vprop) (v_typing: tot_typing g v tm_vprop) : T.Tac (option (x: ppname & t: st_term & c: comp{stateful_comp c /\ comp_pre c == v} & st_typing g t c) )
[ { "abbrev": false, "full_module": "Pulse.Checker.Prover.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": true, "full_module": "Pulse.Typing.Metatheory", "short_module": "Metatheory" }, { "abbrev": false, "full_module": "Pulse.Typing.Combinators", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.VPropEquiv", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker.Prover.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let mk (#g:env) (#v:vprop) (v_typing:tot_typing g v tm_vprop) : T.Tac (option (x:ppname & t:st_term & c:comp { stateful_comp c /\ comp_pre c == v } & st_typing g t c)) = match v.t with | Tm_Pure {t=Tm_FStar pp} -> let p_typing = Metatheory.pure_typing_inversion #g #(tm_fstar pp) v_typing in Some (| ppname_default, mk_elim_pure (tm_fstar pp), elim_pure_comp pp, elim_pure_typing g pp p_typing |) | _ -> None
val mk (#g: env) (#v: vprop) (v_typing: tot_typing g v tm_vprop) : T.Tac (option (x: ppname & t: st_term & c: comp{stateful_comp c /\ comp_pre c == v} & st_typing g t c) ) let mk (#g: env) (#v: vprop) (v_typing: tot_typing g v tm_vprop) : T.Tac (option (x: ppname & t: st_term & c: comp{stateful_comp c /\ comp_pre c == v} & st_typing g t c) ) =
true
null
false
match v.t with | Tm_Pure { t = Tm_FStar pp } -> let p_typing = Metatheory.pure_typing_inversion #g #(tm_fstar pp) v_typing in Some (| ppname_default, mk_elim_pure (tm_fstar pp), elim_pure_comp pp, elim_pure_typing g pp p_typing |) | _ -> None
{ "checked_file": "Pulse.Checker.Prover.ElimPure.fst.checked", "dependencies": [ "Pulse.Typing.Metatheory.fsti.checked", "Pulse.Typing.Combinators.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.Checker.VPropEquiv.fsti.checked", "Pulse.Checker.Pure.fsti.checked", "Pulse.Checker.Prover.Base.fsti.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Range.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": true, "source_file": "Pulse.Checker.Prover.ElimPure.fst" }
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.vprop", "Pulse.Typing.tot_typing", "Pulse.Syntax.Base.tm_vprop", "Pulse.Syntax.Base.__proj__Mkterm__item__t", "Pulse.Syntax.Base.host_term", "Pulse.Syntax.Base.range", "FStar.Pervasives.Native.Some", "FStar.Pervasives.dtuple4", "Pulse.Syntax.Base.ppname", "Pulse.Syntax.Base.st_term", "Pulse.Syntax.Base.comp", "Prims.l_and", "Prims.b2t", "Pulse.Syntax.Base.stateful_comp", "Prims.eq2", "Pulse.Syntax.Base.comp_pre", "Pulse.Typing.st_typing", "FStar.Pervasives.Mkdtuple4", "Pulse.Syntax.Base.ppname_default", "Pulse.Checker.Prover.ElimPure.mk_elim_pure", "Pulse.Checker.Prover.ElimPure.tm_fstar", "Pulse.Checker.Prover.ElimPure.elim_pure_comp", "Pulse.Checker.Prover.ElimPure.elim_pure_typing", "Pulse.Syntax.Base.tm_fstar", "FStar.Reflection.Typing.tm_prop", "FStar.Range.range_0", "Pulse.Typing.Metatheory.Base.pure_typing_inversion", "Pulse.Syntax.Base.term'", "FStar.Pervasives.Native.None", "FStar.Pervasives.Native.option" ]
[]
module Pulse.Checker.Prover.ElimPure module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.List.Tot open Pulse.Syntax open Pulse.Checker.Pure open Pulse.Checker.VPropEquiv open Pulse.Typing open Pulse.Typing.Combinators module Metatheory = Pulse.Typing.Metatheory open Pulse.Reflection.Util open Pulse.Checker.Prover.Base let elim_pure_head = let elim_pure_explicit_lid = mk_pulse_lib_core_lid "elim_pure_explicit" in tm_fvar (as_fv elim_pure_explicit_lid) let elim_pure_head_ty = // let open Pulse.Steel.Wrapper in // let open Steel.Effect.Common in let squash_p = mk_squash u0 (RT.bound_var 0) in let pure_p = mk_pure (RT.bound_var 0) in let post = mk_abs squash_p R.Q_Explicit (R.pack_ln (R.Tv_FVar (R.pack_fv emp_lid))) in let cod = mk_stt_ghost_comp u0 squash_p emp_inames_tm pure_p post in mk_arrow (R.pack_ln (R.Tv_FVar (R.pack_fv R.prop_qn)), R.Q_Explicit) cod // Following crashes in extraction // `(p:prop -> stt_ghost (squash p) emp_inames // (pure p) // (fun _ -> emp)) let tm_fstar t = tm_fstar t Range.range_0 let elim_pure_head_typing (g:env) : tot_typing g elim_pure_head (tm_fstar elim_pure_head_ty) = admit() let mk_elim_pure (p:term) : st_term = let t = Tm_STApp { head = elim_pure_head; arg_qual = None; arg = p } in wtag (Some STT_Ghost) t let elim_pure_comp (p:host_term) = let st : st_comp = { u=u_zero; res=tm_fstar (mk_squash u0 p); pre=tm_pure (tm_fstar p); post=tm_emp } in C_STGhost tm_emp_inames st #push-options "--admit_smt_queries true" let elim_pure_typing (g:env) (p:host_term) (p_prop:tot_typing g (tm_fstar p) (tm_fstar RT.tm_prop)) : st_typing g (mk_elim_pure (tm_fstar p)) (elim_pure_comp p) = T_STApp g elim_pure_head (tm_fstar RT.tm_prop) None (elim_pure_comp p) _ (elim_pure_head_typing g) p_prop #pop-options let is_elim_pure (vp:term) : T.Tac bool = match vp.t with | Tm_Pure {t=Tm_FStar _} -> true | _ -> false let mk (#g:env) (#v:vprop) (v_typing:tot_typing g v tm_vprop) : T.Tac (option (x:ppname & t:st_term & c:comp { stateful_comp c /\ comp_pre c == v } &
false
false
Pulse.Checker.Prover.ElimPure.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val mk (#g: env) (#v: vprop) (v_typing: tot_typing g v tm_vprop) : T.Tac (option (x: ppname & t: st_term & c: comp{stateful_comp c /\ comp_pre c == v} & st_typing g t c) )
[]
Pulse.Checker.Prover.ElimPure.mk
{ "file_name": "lib/steel/pulse/Pulse.Checker.Prover.ElimPure.fst", "git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
v_typing: Pulse.Typing.tot_typing g v Pulse.Syntax.Base.tm_vprop -> FStar.Tactics.Effect.Tac (FStar.Pervasives.Native.option (FStar.Pervasives.dtuple4 Pulse.Syntax.Base.ppname (fun _ -> Pulse.Syntax.Base.st_term) (fun _ _ -> c: Pulse.Syntax.Base.comp {Pulse.Syntax.Base.stateful_comp c /\ Pulse.Syntax.Base.comp_pre c == v}) (fun _ t c -> Pulse.Typing.st_typing g t c)))
{ "end_col": 13, "end_line": 88, "start_col": 2, "start_line": 80 }
Prims.Tot
val all_finite_set_facts_ambient:(squash all_finite_set_facts)
[ { "abbrev": false, "full_module": "FStar.FiniteSet.Base", "short_module": null }, { "abbrev": false, "full_module": "FStar.FiniteSet", "short_module": null }, { "abbrev": false, "full_module": "FStar.FiniteSet", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let all_finite_set_facts_ambient : (squash all_finite_set_facts) = all_finite_set_facts_lemma ()
val all_finite_set_facts_ambient:(squash all_finite_set_facts) let all_finite_set_facts_ambient:(squash all_finite_set_facts) =
false
null
true
all_finite_set_facts_lemma ()
{ "checked_file": "FStar.FiniteSet.Ambient.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.FiniteSet.Base.fsti.checked" ], "interface_file": false, "source_file": "FStar.FiniteSet.Ambient.fst" }
[ "total" ]
[ "FStar.FiniteSet.Base.all_finite_set_facts_lemma" ]
[]
(* Copyright 2008-2021 John Li, Jay Lorch, Rustan Leino, Alex Summers, Dan Rosen, Nikhil Swamy, Microsoft Research, and contributors to the Dafny Project 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. Includes material from the Dafny project (https://github.com/dafny-lang/dafny) which carries this license information: Created 9 February 2008 by Rustan Leino. Converted to Boogie 2 on 28 June 2008. Edited sequence axioms 20 October 2009 by Alex Summers. Modified 2014 by Dan Rosen. Copyright (c) 2008-2014, Microsoft. Copyright by the contributors to the Dafny Project SPDX-License-Identifier: MIT *) (** This module brings properties about finite sets ambiently into the context. The properties are modeled after those in the Dafny sequence axioms, with patterns for quantifiers chosen as in those axioms. @summary Puts properties of finite sets into the ambient context *) module FStar.FiniteSet.Ambient open FStar.FiniteSet.Base
false
true
FStar.FiniteSet.Ambient.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val all_finite_set_facts_ambient:(squash all_finite_set_facts)
[]
FStar.FiniteSet.Ambient.all_finite_set_facts_ambient
{ "file_name": "ulib/FStar.FiniteSet.Ambient.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
Prims.squash FStar.FiniteSet.Base.all_finite_set_facts
{ "end_col": 31, "end_line": 43, "start_col": 2, "start_line": 43 }
Prims.Tot
val va_codegen_success_Check_aesni_support : va_dummy:unit -> Tot va_pbool
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))
val va_codegen_success_Check_aesni_support : va_dummy:unit -> Tot va_pbool let va_codegen_success_Check_aesni_support () =
false
null
false
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx ) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsBasic.va_codegen_success_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_codegen_success_Cpuid_AES", "Vale.X64.InsBasic.va_codegen_success_And64", "Vale.X64.InsBasic.va_codegen_success_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_codegen_success_Check_aesni_support : va_dummy:unit -> Tot va_pbool
[]
Vale.Lib.X64.Cpuid.va_codegen_success_Check_aesni_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
{ "end_col": 81, "end_line": 48, "start_col": 2, "start_line": 39 }
Prims.Tot
val va_code_Check_adx_bmi2_support : va_dummy:unit -> Tot va_code
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))
val va_code_Check_adx_bmi2_support : va_dummy:unit -> Tot va_code let va_code_Check_adx_bmi2_support () =
false
null
false
(va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_Block", "Vale.X64.Decls.va_CCons", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRcx", "Vale.X64.InsBasic.va_code_Cpuid_Adx_Bmi2", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.InsBasic.va_code_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_CNil", "Vale.X64.Decls.va_code" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_code_Check_adx_bmi2_support : va_dummy:unit -> Tot va_code
[]
Vale.Lib.X64.Cpuid.va_code_Check_adx_bmi2_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
{ "end_col": 81, "end_line": 225, "start_col": 2, "start_line": 217 }
Prims.Tot
val va_code_Check_aesni_support : va_dummy:unit -> Tot va_code
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))
val va_code_Check_aesni_support : va_dummy:unit -> Tot va_code let va_code_Check_aesni_support () =
false
null
false
(va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_Block", "Vale.X64.Decls.va_CCons", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_code_Cpuid_AES", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.InsBasic.va_code_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_CNil", "Vale.X64.Decls.va_code" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_code_Check_aesni_support : va_dummy:unit -> Tot va_code
[]
Vale.Lib.X64.Cpuid.va_code_Check_aesni_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
{ "end_col": 81, "end_line": 35, "start_col": 2, "start_line": 27 }
Prims.Tot
val va_codegen_success_Check_sha_support : va_dummy:unit -> Tot va_pbool
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))
val va_codegen_success_Check_sha_support : va_dummy:unit -> Tot va_pbool let va_codegen_success_Check_sha_support () =
false
null
false
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsBasic.va_codegen_success_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRcx", "Vale.X64.InsBasic.va_codegen_success_Cpuid_Sha", "Vale.X64.InsBasic.va_codegen_success_And64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_codegen_success_Check_sha_support : va_dummy:unit -> Tot va_pbool
[]
Vale.Lib.X64.Cpuid.va_codegen_success_Check_sha_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
{ "end_col": 14, "end_line": 152, "start_col": 2, "start_line": 145 }
Prims.Tot
val va_code_Check_avx_support : va_dummy:unit -> Tot va_code
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))
val va_code_Check_avx_support : va_dummy:unit -> Tot va_code let va_code_Check_avx_support () =
false
null
false
(va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_Block", "Vale.X64.Decls.va_CCons", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_code_Cpuid_Avx", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.InsBasic.va_code_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_CNil", "Vale.X64.Decls.va_code" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_code_Check_avx_support : va_dummy:unit -> Tot va_code
[]
Vale.Lib.X64.Cpuid.va_code_Check_avx_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
{ "end_col": 79, "end_line": 332, "start_col": 2, "start_line": 326 }
Prims.Tot
val va_codegen_success_Check_avx_support : va_dummy:unit -> Tot va_pbool
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))
val va_codegen_success_Check_avx_support : va_dummy:unit -> Tot va_pbool let va_codegen_success_Check_avx_support () =
false
null
false
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsBasic.va_codegen_success_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_codegen_success_Cpuid_Avx", "Vale.X64.InsBasic.va_codegen_success_And64", "Vale.X64.InsBasic.va_codegen_success_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_codegen_success_Check_avx_support : va_dummy:unit -> Tot va_pbool
[]
Vale.Lib.X64.Cpuid.va_codegen_success_Check_avx_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
{ "end_col": 15, "end_line": 344, "start_col": 2, "start_line": 336 }
Prims.Tot
val va_code_Check_avx2_support : va_dummy:unit -> Tot va_code
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))
val va_code_Check_avx2_support : va_dummy:unit -> Tot va_code let va_code_Check_avx2_support () =
false
null
false
(va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_Block", "Vale.X64.Decls.va_CCons", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRcx", "Vale.X64.InsBasic.va_code_Cpuid_Avx2", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.Decls.va_CNil", "Vale.X64.Decls.va_code" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_code_Check_avx2_support : va_dummy:unit -> Tot va_code
[]
Vale.Lib.X64.Cpuid.va_code_Check_avx2_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
{ "end_col": 78, "end_line": 422, "start_col": 2, "start_line": 417 }
Prims.Tot
val va_codegen_success_Check_avx_xcr0_support : va_dummy:unit -> Tot va_pbool
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_codegen_success_Check_avx_xcr0_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Xgetbv_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))
val va_codegen_success_Check_avx_xcr0_support : va_dummy:unit -> Tot va_pbool let va_codegen_success_Check_avx_xcr0_support () =
false
null
false
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Xgetbv_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsBasic.va_codegen_success_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.InsBasic.va_codegen_success_Xgetbv_Avx", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_codegen_success_And64", "Vale.X64.InsBasic.va_codegen_success_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_rdrand_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_rdrand_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_rdrand_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 245 column 36 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> rdrand_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_rdrand_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx512_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx512_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx512_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 277 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx512 ()) (fun (va_s:va_state) _ -> let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg49 16) (let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg48 17) (let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 280 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg47 30) (let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 281 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg46 31) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 284 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 285 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 286 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 288 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 289 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 290 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 292 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (65536 == Prims.pow2 16)) (fun _ -> (fun (p:prop) -> p) (65536 == Prims.pow2 16)) (fun (_:unit) -> assert_normalize (65536 == Prims.pow2 16)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 293 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (131072 == Prims.pow2 17)) (fun _ -> (fun (p:prop) -> p) (131072 == Prims.pow2 17)) (fun (_:unit) -> assert_normalize (131072 == Prims.pow2 17)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 294 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 295 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2147483648 == Prims.pow2 31)) (fun _ -> (fun (p:prop) -> p) (2147483648 == Prims.pow2 31)) (fun (_:unit) -> assert_normalize (2147483648 == Prims.pow2 31)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 297 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 17) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 299 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 301 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 302 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 303 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 14) (let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 305 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg44 va_arg45 16) (let (va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg43 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 307 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 310 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 311 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 312 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 313 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 31) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 15) (let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 316 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg41 va_arg42 16) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (fun (va_s:va_state) _ -> let (va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 318 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg39 va_arg40 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 319 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 321 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx512_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx512_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx512_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 265 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 42 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx512_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx512_support (va_code_Check_avx512_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_osxsave_support [@ "opaque_to_smt" va_qattr] let va_code_Check_osxsave_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Osxsave ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_osxsave_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Osxsave ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_osxsave_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_osxsave_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 332 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 334 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 335 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 336 column 18 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Osxsave ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 337 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 339 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 340 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (134217728 == Prims.pow2 27)) (fun _ -> (fun (p:prop) -> p) (134217728 == Prims.pow2 27)) (fun (_:unit) -> assert_normalize (134217728 == Prims.pow2 27)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 342 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 343 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 27) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 344 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 26) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 346 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_osxsave_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_osxsave_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_osxsave_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 329 column 37 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> osxsave_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 330 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_osxsave_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_osxsave_support (va_code_Check_osxsave_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_xcr0_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_xcr0_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Xgetbv_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_codegen_success_Check_avx_xcr0_support : va_dummy:unit -> Tot va_pbool
[]
Vale.Lib.X64.Cpuid.va_codegen_success_Check_avx_xcr0_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
{ "end_col": 79, "end_line": 1108, "start_col": 2, "start_line": 1102 }
Prims.Tot
val va_code_Check_movbe_support : va_dummy:unit -> Tot va_code
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))
val va_code_Check_movbe_support : va_dummy:unit -> Tot va_code let va_code_Check_movbe_support () =
false
null
false
(va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_Block", "Vale.X64.Decls.va_CCons", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_code_Cpuid_Movbe", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.InsBasic.va_code_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_CNil", "Vale.X64.Decls.va_code" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_code_Check_movbe_support : va_dummy:unit -> Tot va_code
[]
Vale.Lib.X64.Cpuid.va_code_Check_movbe_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
{ "end_col": 79, "end_line": 502, "start_col": 2, "start_line": 496 }
Prims.Tot
val va_code_Check_avx512_support : va_dummy:unit -> Tot va_code
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_code_Check_avx512_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))))))))))))
val va_code_Check_avx512_support : va_dummy:unit -> Tot va_code let va_code_Check_avx512_support () =
false
null
false
(va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR10 ) (va_const_shift_amt64 14)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax ) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10) ) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11 )) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) ))))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_Block", "Vale.X64.Decls.va_CCons", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRcx", "Vale.X64.InsBasic.va_code_Cpuid_Avx512", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR11", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.InsBasic.va_code_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_CNil", "Vale.X64.Decls.va_code" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_rdrand_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_rdrand_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_rdrand_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 245 column 36 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> rdrand_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_rdrand_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_support [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_code_Check_avx512_support : va_dummy:unit -> Tot va_code
[]
Vale.Lib.X64.Cpuid.va_code_Check_avx512_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
{ "end_col": 90, "end_line": 834, "start_col": 2, "start_line": 817 }
Prims.Tot
val va_codegen_success_Check_osxsave_support : va_dummy:unit -> Tot va_pbool
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_codegen_success_Check_osxsave_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Osxsave ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))
val va_codegen_success_Check_osxsave_support : va_dummy:unit -> Tot va_pbool let va_codegen_success_Check_osxsave_support () =
false
null
false
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Osxsave ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsBasic.va_codegen_success_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_codegen_success_Cpuid_Osxsave", "Vale.X64.InsBasic.va_codegen_success_And64", "Vale.X64.InsBasic.va_codegen_success_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_rdrand_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_rdrand_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_rdrand_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 245 column 36 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> rdrand_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_rdrand_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx512_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx512_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx512_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 277 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx512 ()) (fun (va_s:va_state) _ -> let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg49 16) (let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg48 17) (let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 280 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg47 30) (let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 281 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg46 31) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 284 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 285 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 286 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 288 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 289 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 290 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 292 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (65536 == Prims.pow2 16)) (fun _ -> (fun (p:prop) -> p) (65536 == Prims.pow2 16)) (fun (_:unit) -> assert_normalize (65536 == Prims.pow2 16)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 293 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (131072 == Prims.pow2 17)) (fun _ -> (fun (p:prop) -> p) (131072 == Prims.pow2 17)) (fun (_:unit) -> assert_normalize (131072 == Prims.pow2 17)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 294 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 295 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2147483648 == Prims.pow2 31)) (fun _ -> (fun (p:prop) -> p) (2147483648 == Prims.pow2 31)) (fun (_:unit) -> assert_normalize (2147483648 == Prims.pow2 31)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 297 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 17) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 299 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 301 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 302 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 303 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 14) (let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 305 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg44 va_arg45 16) (let (va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg43 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 307 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 310 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 311 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 312 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 313 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 31) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 15) (let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 316 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg41 va_arg42 16) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (fun (va_s:va_state) _ -> let (va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 318 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg39 va_arg40 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 319 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 321 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx512_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx512_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx512_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 265 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 42 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx512_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx512_support (va_code_Check_avx512_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_osxsave_support [@ "opaque_to_smt" va_qattr] let va_code_Check_osxsave_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Osxsave ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_codegen_success_Check_osxsave_support : va_dummy:unit -> Tot va_pbool
[]
Vale.Lib.X64.Cpuid.va_codegen_success_Check_osxsave_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
{ "end_col": 15, "end_line": 1020, "start_col": 2, "start_line": 1012 }
Prims.Tot
val va_codegen_success_Check_sse_support : va_dummy:unit -> Tot va_pbool
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))))))
val va_codegen_success_Check_sse_support : va_dummy:unit -> Tot va_pbool let va_codegen_success_Check_sse_support () =
false
null
false
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx ) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsBasic.va_codegen_success_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_codegen_success_Cpuid_Sse", "Vale.X64.InsBasic.va_codegen_success_And64", "Vale.X64.Machine_s.rRdx", "Vale.X64.InsBasic.va_codegen_success_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_codegen_success_Check_sse_support : va_dummy:unit -> Tot va_pbool
[]
Vale.Lib.X64.Cpuid.va_codegen_success_Check_sse_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
{ "end_col": 84, "end_line": 613, "start_col": 2, "start_line": 601 }
Prims.Tot
val va_code_Check_sha_support : va_dummy:unit -> Tot va_code
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))
val va_code_Check_sha_support : va_dummy:unit -> Tot va_code let va_code_Check_sha_support () =
false
null
false
(va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912) ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_Block", "Vale.X64.Decls.va_CCons", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRcx", "Vale.X64.InsBasic.va_code_Cpuid_Sha", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.Decls.va_CNil", "Vale.X64.Decls.va_code" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_code_Check_sha_support : va_dummy:unit -> Tot va_code
[]
Vale.Lib.X64.Cpuid.va_code_Check_sha_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
{ "end_col": 78, "end_line": 141, "start_col": 2, "start_line": 136 }
Prims.Tot
val va_code_Check_sse_support : va_dummy:unit -> Tot va_code
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))))))
val va_code_Check_sse_support : va_dummy:unit -> Tot va_code let va_code_Check_sse_support () =
false
null
false
(va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax ) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx ) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_Block", "Vale.X64.Decls.va_CCons", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_code_Cpuid_Sse", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.Machine_s.rRdx", "Vale.X64.InsBasic.va_code_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_CNil", "Vale.X64.Decls.va_code" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_code_Check_sse_support : va_dummy:unit -> Tot va_code
[]
Vale.Lib.X64.Cpuid.va_code_Check_sse_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
{ "end_col": 84, "end_line": 597, "start_col": 2, "start_line": 586 }
Prims.Tot
val va_code_Check_osxsave_support : va_dummy:unit -> Tot va_code
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_code_Check_osxsave_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Osxsave ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))
val va_code_Check_osxsave_support : va_dummy:unit -> Tot va_code let va_code_Check_osxsave_support () =
false
null
false
(va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Osxsave ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_Block", "Vale.X64.Decls.va_CCons", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_code_Cpuid_Osxsave", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.InsBasic.va_code_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_CNil", "Vale.X64.Decls.va_code" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_rdrand_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_rdrand_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_rdrand_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 245 column 36 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> rdrand_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_rdrand_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx512_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx512_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx512_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 277 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx512 ()) (fun (va_s:va_state) _ -> let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg49 16) (let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg48 17) (let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 280 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg47 30) (let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 281 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg46 31) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 284 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 285 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 286 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 288 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 289 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 290 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 292 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (65536 == Prims.pow2 16)) (fun _ -> (fun (p:prop) -> p) (65536 == Prims.pow2 16)) (fun (_:unit) -> assert_normalize (65536 == Prims.pow2 16)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 293 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (131072 == Prims.pow2 17)) (fun _ -> (fun (p:prop) -> p) (131072 == Prims.pow2 17)) (fun (_:unit) -> assert_normalize (131072 == Prims.pow2 17)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 294 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 295 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2147483648 == Prims.pow2 31)) (fun _ -> (fun (p:prop) -> p) (2147483648 == Prims.pow2 31)) (fun (_:unit) -> assert_normalize (2147483648 == Prims.pow2 31)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 297 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 17) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 299 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 301 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 302 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 303 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 14) (let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 305 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg44 va_arg45 16) (let (va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg43 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 307 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 310 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 311 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 312 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 313 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 31) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 15) (let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 316 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg41 va_arg42 16) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (fun (va_s:va_state) _ -> let (va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 318 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg39 va_arg40 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 319 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 321 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx512_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx512_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx512_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 265 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 42 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx512_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx512_support (va_code_Check_avx512_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_osxsave_support [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_code_Check_osxsave_support : va_dummy:unit -> Tot va_code
[]
Vale.Lib.X64.Cpuid.va_code_Check_osxsave_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
{ "end_col": 16, "end_line": 1008, "start_col": 2, "start_line": 1001 }
Prims.Tot
val va_codegen_success_Check_rdrand_support : va_dummy:unit -> Tot va_pbool
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))
val va_codegen_success_Check_rdrand_support : va_dummy:unit -> Tot va_pbool let va_codegen_success_Check_rdrand_support () =
false
null
false
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsBasic.va_codegen_success_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_codegen_success_Cpuid_Rdrand", "Vale.X64.InsBasic.va_codegen_success_And64", "Vale.X64.InsBasic.va_codegen_success_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_codegen_success_Check_rdrand_support : va_dummy:unit -> Tot va_pbool
[]
Vale.Lib.X64.Cpuid.va_codegen_success_Check_rdrand_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
{ "end_col": 15, "end_line": 744, "start_col": 2, "start_line": 736 }
Prims.Tot
val va_code_Check_avx_xcr0_support : va_dummy:unit -> Tot va_code
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_code_Check_avx_xcr0_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Xgetbv_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))
val va_code_Check_avx_xcr0_support : va_dummy:unit -> Tot va_code let va_code_Check_avx_xcr0_support () =
false
null
false
(va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Xgetbv_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_Block", "Vale.X64.Decls.va_CCons", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.InsBasic.va_code_Xgetbv_Avx", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.InsBasic.va_code_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_CNil", "Vale.X64.Decls.va_code" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_rdrand_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_rdrand_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_rdrand_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 245 column 36 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> rdrand_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_rdrand_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx512_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx512_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx512_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 277 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx512 ()) (fun (va_s:va_state) _ -> let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg49 16) (let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg48 17) (let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 280 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg47 30) (let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 281 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg46 31) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 284 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 285 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 286 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 288 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 289 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 290 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 292 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (65536 == Prims.pow2 16)) (fun _ -> (fun (p:prop) -> p) (65536 == Prims.pow2 16)) (fun (_:unit) -> assert_normalize (65536 == Prims.pow2 16)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 293 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (131072 == Prims.pow2 17)) (fun _ -> (fun (p:prop) -> p) (131072 == Prims.pow2 17)) (fun (_:unit) -> assert_normalize (131072 == Prims.pow2 17)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 294 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 295 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2147483648 == Prims.pow2 31)) (fun _ -> (fun (p:prop) -> p) (2147483648 == Prims.pow2 31)) (fun (_:unit) -> assert_normalize (2147483648 == Prims.pow2 31)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 297 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 17) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 299 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 301 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 302 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 303 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 14) (let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 305 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg44 va_arg45 16) (let (va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg43 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 307 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 310 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 311 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 312 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 313 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 31) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 15) (let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 316 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg41 va_arg42 16) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (fun (va_s:va_state) _ -> let (va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 318 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg39 va_arg40 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 319 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 321 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx512_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx512_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx512_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 265 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 42 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx512_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx512_support (va_code_Check_avx512_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_osxsave_support [@ "opaque_to_smt" va_qattr] let va_code_Check_osxsave_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Osxsave ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_osxsave_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Osxsave ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_osxsave_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_osxsave_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 332 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 334 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 335 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 336 column 18 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Osxsave ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 337 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 339 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 340 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (134217728 == Prims.pow2 27)) (fun _ -> (fun (p:prop) -> p) (134217728 == Prims.pow2 27)) (fun (_:unit) -> assert_normalize (134217728 == Prims.pow2 27)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 342 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 343 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 27) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 344 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 26) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 346 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_osxsave_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_osxsave_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_osxsave_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 329 column 37 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> osxsave_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 330 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_osxsave_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_osxsave_support (va_code_Check_osxsave_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_xcr0_support [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_code_Check_avx_xcr0_support : va_dummy:unit -> Tot va_code
[]
Vale.Lib.X64.Cpuid.va_code_Check_avx_xcr0_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
{ "end_col": 79, "end_line": 1098, "start_col": 2, "start_line": 1093 }
Prims.Tot
val va_code_Check_rdrand_support : va_dummy:unit -> Tot va_code
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))
val va_code_Check_rdrand_support : va_dummy:unit -> Tot va_code let va_code_Check_rdrand_support () =
false
null
false
(va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_Block", "Vale.X64.Decls.va_CCons", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_code_Cpuid_Rdrand", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.InsBasic.va_code_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_CNil", "Vale.X64.Decls.va_code" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_code_Check_rdrand_support : va_dummy:unit -> Tot va_code
[]
Vale.Lib.X64.Cpuid.va_code_Check_rdrand_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
{ "end_col": 79, "end_line": 732, "start_col": 2, "start_line": 726 }
Prims.Tot
val va_codegen_success_Check_avx512_xcr0_support : va_dummy:unit -> Tot va_pbool
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_codegen_success_Check_avx512_xcr0_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Xgetbv_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 64)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 128)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 2)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRcx) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))
val va_codegen_success_Check_avx512_xcr0_support : va_dummy:unit -> Tot va_pbool let va_codegen_success_Check_avx512_xcr0_support () =
false
null
false
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Xgetbv_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 64)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 128)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 2)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRcx) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax ) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsBasic.va_codegen_success_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.InsBasic.va_codegen_success_Xgetbv_Avx512", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRax", "Vale.X64.Machine_s.rRdx", "Vale.X64.InsBasic.va_codegen_success_And64", "Vale.X64.InsBasic.va_codegen_success_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_rdrand_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_rdrand_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_rdrand_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 245 column 36 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> rdrand_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_rdrand_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx512_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx512_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx512_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 277 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx512 ()) (fun (va_s:va_state) _ -> let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg49 16) (let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg48 17) (let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 280 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg47 30) (let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 281 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg46 31) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 284 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 285 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 286 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 288 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 289 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 290 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 292 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (65536 == Prims.pow2 16)) (fun _ -> (fun (p:prop) -> p) (65536 == Prims.pow2 16)) (fun (_:unit) -> assert_normalize (65536 == Prims.pow2 16)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 293 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (131072 == Prims.pow2 17)) (fun _ -> (fun (p:prop) -> p) (131072 == Prims.pow2 17)) (fun (_:unit) -> assert_normalize (131072 == Prims.pow2 17)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 294 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 295 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2147483648 == Prims.pow2 31)) (fun _ -> (fun (p:prop) -> p) (2147483648 == Prims.pow2 31)) (fun (_:unit) -> assert_normalize (2147483648 == Prims.pow2 31)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 297 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 17) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 299 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 301 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 302 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 303 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 14) (let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 305 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg44 va_arg45 16) (let (va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg43 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 307 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 310 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 311 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 312 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 313 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 31) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 15) (let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 316 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg41 va_arg42 16) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (fun (va_s:va_state) _ -> let (va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 318 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg39 va_arg40 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 319 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 321 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx512_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx512_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx512_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 265 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 42 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx512_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx512_support (va_code_Check_avx512_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_osxsave_support [@ "opaque_to_smt" va_qattr] let va_code_Check_osxsave_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Osxsave ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_osxsave_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Osxsave ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_osxsave_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_osxsave_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 332 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 334 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 335 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 336 column 18 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Osxsave ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 337 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 339 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 340 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (134217728 == Prims.pow2 27)) (fun _ -> (fun (p:prop) -> p) (134217728 == Prims.pow2 27)) (fun (_:unit) -> assert_normalize (134217728 == Prims.pow2 27)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 342 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 343 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 27) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 344 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 26) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 346 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_osxsave_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_osxsave_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_osxsave_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 329 column 37 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> osxsave_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 330 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_osxsave_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_osxsave_support (va_code_Check_osxsave_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_xcr0_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_xcr0_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Xgetbv_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_xcr0_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Xgetbv_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_xcr0_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_xcr0_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 358 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 359 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Xgetbv_Avx ()) (fun (va_s:va_state) _ -> let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 360 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg19 1) (let (va_arg18:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 361 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg18 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 362 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 364 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 366 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 367 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4 == Prims.pow2 2)) (fun _ -> (fun (p:prop) -> p) (4 == Prims.pow2 2)) (fun (_:unit) -> assert_normalize (4 == Prims.pow2 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 369 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 370 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 2) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 371 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 373 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg17:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg16:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 374 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg16 va_arg17 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 375 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (()))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_xcr0_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_xcr0_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_xcr0_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 349 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 356 column 30 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_xcr0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_xcr0_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_xcr0_support (va_code_Check_avx_xcr0_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_xcr0_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_xcr0_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Xgetbv_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 32)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 64)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 128)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 2)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRcx) (va_const_shift_amt64 1)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_codegen_success_Check_avx512_xcr0_support : va_dummy:unit -> Tot va_pbool
[]
Vale.Lib.X64.Cpuid.va_codegen_success_Check_avx512_xcr0_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
{ "end_col": 83, "end_line": 1209, "start_col": 2, "start_line": 1199 }
Prims.Tot
val va_code_Check_avx512_xcr0_support : va_dummy:unit -> Tot va_code
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_code_Check_avx512_xcr0_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Xgetbv_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 32)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 64)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 128)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 2)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRcx) (va_const_shift_amt64 1)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))
val va_code_Check_avx512_xcr0_support : va_dummy:unit -> Tot va_code let va_code_Check_avx512_xcr0_support () =
false
null
false
(va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Xgetbv_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 32)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 64)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 128)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 2)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRcx) (va_const_shift_amt64 1)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_Block", "Vale.X64.Decls.va_CCons", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.InsBasic.va_code_Xgetbv_Avx512", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRax", "Vale.X64.Machine_s.rRdx", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.InsBasic.va_code_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_CNil", "Vale.X64.Decls.va_code" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_rdrand_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_rdrand_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_rdrand_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 245 column 36 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> rdrand_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_rdrand_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx512_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx512_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx512_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 277 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx512 ()) (fun (va_s:va_state) _ -> let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg49 16) (let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg48 17) (let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 280 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg47 30) (let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 281 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg46 31) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 284 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 285 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 286 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 288 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 289 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 290 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 292 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (65536 == Prims.pow2 16)) (fun _ -> (fun (p:prop) -> p) (65536 == Prims.pow2 16)) (fun (_:unit) -> assert_normalize (65536 == Prims.pow2 16)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 293 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (131072 == Prims.pow2 17)) (fun _ -> (fun (p:prop) -> p) (131072 == Prims.pow2 17)) (fun (_:unit) -> assert_normalize (131072 == Prims.pow2 17)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 294 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 295 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2147483648 == Prims.pow2 31)) (fun _ -> (fun (p:prop) -> p) (2147483648 == Prims.pow2 31)) (fun (_:unit) -> assert_normalize (2147483648 == Prims.pow2 31)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 297 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 17) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 299 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 301 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 302 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 303 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 14) (let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 305 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg44 va_arg45 16) (let (va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg43 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 307 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 310 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 311 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 312 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 313 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 31) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 15) (let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 316 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg41 va_arg42 16) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (fun (va_s:va_state) _ -> let (va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 318 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg39 va_arg40 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 319 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 321 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx512_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx512_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx512_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 265 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 42 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx512_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx512_support (va_code_Check_avx512_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_osxsave_support [@ "opaque_to_smt" va_qattr] let va_code_Check_osxsave_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Osxsave ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_osxsave_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Osxsave ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_osxsave_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_osxsave_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 332 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 334 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 335 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 336 column 18 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Osxsave ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 337 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 339 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 340 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (134217728 == Prims.pow2 27)) (fun _ -> (fun (p:prop) -> p) (134217728 == Prims.pow2 27)) (fun (_:unit) -> assert_normalize (134217728 == Prims.pow2 27)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 342 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 343 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 27) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 344 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 26) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 346 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_osxsave_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_osxsave_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_osxsave_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 329 column 37 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> osxsave_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 330 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_osxsave_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_osxsave_support (va_code_Check_osxsave_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_xcr0_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_xcr0_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Xgetbv_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_xcr0_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Xgetbv_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_xcr0_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_xcr0_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 358 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 359 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Xgetbv_Avx ()) (fun (va_s:va_state) _ -> let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 360 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg19 1) (let (va_arg18:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 361 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg18 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 362 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 364 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 366 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 367 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4 == Prims.pow2 2)) (fun _ -> (fun (p:prop) -> p) (4 == Prims.pow2 2)) (fun (_:unit) -> assert_normalize (4 == Prims.pow2 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 369 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 370 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 2) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 371 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 373 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg17:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg16:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 374 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg16 va_arg17 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 375 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (()))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_xcr0_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_xcr0_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_xcr0_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 349 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 356 column 30 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_xcr0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_xcr0_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_xcr0_support (va_code_Check_avx_xcr0_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_xcr0_support [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_code_Check_avx512_xcr0_support : va_dummy:unit -> Tot va_code
[]
Vale.Lib.X64.Cpuid.va_code_Check_avx512_xcr0_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
{ "end_col": 83, "end_line": 1195, "start_col": 2, "start_line": 1186 }
Prims.Tot
val va_codegen_success_Check_adx_bmi2_support : va_dummy:unit -> Tot va_pbool
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))
val va_codegen_success_Check_adx_bmi2_support : va_dummy:unit -> Tot va_pbool let va_codegen_success_Check_adx_bmi2_support () =
false
null
false
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx ) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsBasic.va_codegen_success_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRcx", "Vale.X64.InsBasic.va_codegen_success_Cpuid_Adx_Bmi2", "Vale.X64.InsBasic.va_codegen_success_And64", "Vale.X64.InsBasic.va_codegen_success_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_codegen_success_Check_adx_bmi2_support : va_dummy:unit -> Tot va_pbool
[]
Vale.Lib.X64.Cpuid.va_codegen_success_Check_adx_bmi2_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
{ "end_col": 81, "end_line": 238, "start_col": 2, "start_line": 229 }
Prims.Tot
val va_codegen_success_Check_avx2_support : va_dummy:unit -> Tot va_pbool
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))
val va_codegen_success_Check_avx2_support : va_dummy:unit -> Tot va_pbool let va_codegen_success_Check_avx2_support () =
false
null
false
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsBasic.va_codegen_success_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRcx", "Vale.X64.InsBasic.va_codegen_success_Cpuid_Avx2", "Vale.X64.InsBasic.va_codegen_success_And64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_codegen_success_Check_avx2_support : va_dummy:unit -> Tot va_pbool
[]
Vale.Lib.X64.Cpuid.va_codegen_success_Check_avx2_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
{ "end_col": 78, "end_line": 432, "start_col": 2, "start_line": 426 }
Prims.Tot
val va_codegen_success_Check_movbe_support : va_dummy:unit -> Tot va_pbool
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))
val va_codegen_success_Check_movbe_support : va_dummy:unit -> Tot va_pbool let va_codegen_success_Check_movbe_support () =
false
null
false
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsBasic.va_codegen_success_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_codegen_success_Cpuid_Movbe", "Vale.X64.InsBasic.va_codegen_success_And64", "Vale.X64.InsBasic.va_codegen_success_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_codegen_success_Check_movbe_support : va_dummy:unit -> Tot va_pbool
[]
Vale.Lib.X64.Cpuid.va_codegen_success_Check_movbe_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
{ "end_col": 79, "end_line": 513, "start_col": 2, "start_line": 506 }
Prims.Tot
val va_codegen_success_Check_avx512_support : va_dummy:unit -> Tot va_pbool
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_codegen_success_Check_avx512_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))))))))))))
val va_codegen_success_Check_avx512_support : va_dummy:unit -> Tot va_pbool let va_codegen_success_Check_avx512_support () =
false
null
false
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR10 ) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Shr64 ( va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax ) (va_op_opr64_reg64 rR11) ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9 )) (va_ttrue ())))))))))))) ))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Prims.unit", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsBasic.va_codegen_success_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRcx", "Vale.X64.InsBasic.va_codegen_success_Cpuid_Avx512", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR11", "Vale.X64.InsBasic.va_codegen_success_And64", "Vale.X64.InsBasic.va_codegen_success_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_rdrand_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_rdrand_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_rdrand_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 245 column 36 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> rdrand_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_rdrand_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr]
false
true
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_codegen_success_Check_avx512_support : va_dummy:unit -> Tot va_pbool
[]
Vale.Lib.X64.Cpuid.va_codegen_success_Check_avx512_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
{ "end_col": 36, "end_line": 857, "start_col": 2, "start_line": 838 }
Prims.Ghost
val va_wpProof_Check_avx2_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_avx2_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_avx2_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
val va_wpProof_Check_avx2_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_avx2_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_avx2_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) let va_wpProof_Check_avx2_support va_s0 va_k =
false
null
false
let va_sM, va_f0 = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Lib.X64.Cpuid.va_lemma_Check_avx2_support", "Vale.Lib.X64.Cpuid.va_code_Check_avx2_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_wpProof_Check_avx2_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_avx2_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_avx2_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[]
Vale.Lib.X64.Cpuid.va_wpProof_Check_avx2_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
{ "end_col": 22, "end_line": 489, "start_col": 46, "start_line": 480 }
Prims.Ghost
val va_lemma_Check_aesni_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_aesni_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
val va_lemma_Check_aesni_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_aesni_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))) let va_lemma_Check_aesni_support va_b0 va_s0 =
false
null
false
let va_mods:va_mods_t = [ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok ] in let va_qc = va_qcode_Check_aesni_support va_mods in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Lib.X64.Cpuid.va_code_Check_aesni_support", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.l_imp", "Prims.l_not", "Prims.int", "Vale.X64.Decls.va_get_reg64", "Vale.X64.CPU_Features_s.aesni_enabled", "Vale.X64.CPU_Features_s.pclmulqdq_enabled", "Vale.Def.Types_s.nat64", "Vale.X64.QuickCode.quickCode", "Vale.Lib.X64.Cpuid.va_qcode_Check_aesni_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_lemma_Check_aesni_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_aesni_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))
[]
Vale.Lib.X64.Cpuid.va_lemma_Check_aesni_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
{ "end_col": 16, "end_line": 116, "start_col": 46, "start_line": 101 }
Prims.Ghost
val va_wpProof_Check_aesni_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_aesni_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_aesni_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
val va_wpProof_Check_aesni_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_aesni_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_aesni_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) let va_wpProof_Check_aesni_support va_s0 va_k =
false
null
false
let va_sM, va_f0 = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Lib.X64.Cpuid.va_lemma_Check_aesni_support", "Vale.Lib.X64.Cpuid.va_code_Check_aesni_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_wpProof_Check_aesni_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_aesni_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_aesni_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[]
Vale.Lib.X64.Cpuid.va_wpProof_Check_aesni_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
{ "end_col": 22, "end_line": 129, "start_col": 47, "start_line": 120 }
Prims.Ghost
val va_lemma_Check_sha_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_sha_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
val va_lemma_Check_sha_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_sha_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))) let va_lemma_Check_sha_support va_b0 va_s0 =
false
null
false
let va_mods:va_mods_t = [ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok ] in let va_qc = va_qcode_Check_sha_support va_mods in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Lib.X64.Cpuid.va_code_Check_sha_support", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.l_imp", "Prims.l_not", "Prims.int", "Vale.X64.Decls.va_get_reg64", "Vale.X64.CPU_Features_s.sha_enabled", "Vale.Def.Types_s.nat64", "Vale.X64.QuickCode.quickCode", "Vale.Lib.X64.Cpuid.va_qcode_Check_sha_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_lemma_Check_sha_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_sha_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))
[]
Vale.Lib.X64.Cpuid.va_lemma_Check_sha_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
{ "end_col": 16, "end_line": 197, "start_col": 44, "start_line": 182 }
Prims.Ghost
val va_lemma_Check_avx2_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_avx2_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
val va_lemma_Check_avx2_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_avx2_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))) let va_lemma_Check_avx2_support va_b0 va_s0 =
false
null
false
let va_mods:va_mods_t = [ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok ] in let va_qc = va_qcode_Check_avx2_support va_mods in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Lib.X64.Cpuid.va_code_Check_avx2_support", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.l_imp", "Prims.l_not", "Prims.int", "Vale.X64.Decls.va_get_reg64", "Vale.X64.CPU_Features_s.avx2_cpuid_enabled", "Vale.Def.Types_s.nat64", "Vale.X64.QuickCode.quickCode", "Vale.Lib.X64.Cpuid.va_qcode_Check_avx2_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_lemma_Check_avx2_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_avx2_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))
[]
Vale.Lib.X64.Cpuid.va_lemma_Check_avx2_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
{ "end_col": 16, "end_line": 476, "start_col": 45, "start_line": 461 }
Prims.Ghost
val va_wpProof_Check_sha_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_sha_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_sha_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
val va_wpProof_Check_sha_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_sha_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_sha_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) let va_wpProof_Check_sha_support va_s0 va_k =
false
null
false
let va_sM, va_f0 = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Lib.X64.Cpuid.va_lemma_Check_sha_support", "Vale.Lib.X64.Cpuid.va_code_Check_sha_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_wpProof_Check_sha_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_sha_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_sha_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[]
Vale.Lib.X64.Cpuid.va_wpProof_Check_sha_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
{ "end_col": 22, "end_line": 210, "start_col": 45, "start_line": 201 }
Prims.Ghost
val va_wpProof_Check_avx512_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_avx512_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_avx512_support ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_wpProof_Check_avx512_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx512_support (va_code_Check_avx512_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
val va_wpProof_Check_avx512_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_avx512_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_avx512_support ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) let va_wpProof_Check_avx512_support va_s0 va_k =
false
null
false
let va_sM, va_f0 = va_lemma_Check_avx512_support (va_code_Check_avx512_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Lib.X64.Cpuid.va_lemma_Check_avx512_support", "Vale.Lib.X64.Cpuid.va_code_Check_avx512_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_rdrand_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_rdrand_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_rdrand_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 245 column 36 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> rdrand_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_rdrand_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx512_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx512_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx512_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 277 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx512 ()) (fun (va_s:va_state) _ -> let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg49 16) (let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg48 17) (let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 280 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg47 30) (let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 281 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg46 31) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 284 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 285 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 286 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 288 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 289 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 290 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 292 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (65536 == Prims.pow2 16)) (fun _ -> (fun (p:prop) -> p) (65536 == Prims.pow2 16)) (fun (_:unit) -> assert_normalize (65536 == Prims.pow2 16)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 293 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (131072 == Prims.pow2 17)) (fun _ -> (fun (p:prop) -> p) (131072 == Prims.pow2 17)) (fun (_:unit) -> assert_normalize (131072 == Prims.pow2 17)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 294 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 295 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2147483648 == Prims.pow2 31)) (fun _ -> (fun (p:prop) -> p) (2147483648 == Prims.pow2 31)) (fun (_:unit) -> assert_normalize (2147483648 == Prims.pow2 31)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 297 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 17) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 299 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 301 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 302 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 303 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 14) (let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 305 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg44 va_arg45 16) (let (va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg43 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 307 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 310 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 311 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 312 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 313 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 31) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 15) (let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 316 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg41 va_arg42 16) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (fun (va_s:va_state) _ -> let (va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 318 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg39 va_arg40 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 319 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 321 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx512_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx512_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx512_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 265 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 42 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_wpProof_Check_avx512_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_avx512_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_avx512_support ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[]
Vale.Lib.X64.Cpuid.va_wpProof_Check_avx512_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
{ "end_col": 22, "end_line": 994, "start_col": 48, "start_line": 985 }
Prims.Tot
val va_qcode_Check_sha_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ()))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))
val va_qcode_Check_sha_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) let va_qcode_Check_sha_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) =
false
null
false
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s: va_state) _ -> let va_arg11:Vale.Def.Types_s.nat64 = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s: va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p: prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p: prop) -> p) (536870912 == Prims.pow2 29)) (fun (_: unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Vale.X64.QuickCode.va_mods_t", "Vale.X64.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.X64.Decls.va_code", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRcx", "Vale.X64.InsBasic.va_code_Cpuid_Sha", "Vale.X64.InsBasic.va_code_And64", "Prims.Nil", "Vale.X64.Machine_s.precode", "Vale.X64.Decls.ins", "Vale.X64.Decls.ocmp", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.va_QSeq", "Vale.X64.QuickCodes.va_range1", "Vale.X64.InsBasic.va_quick_Mov64", "Vale.X64.QuickCodes.va_QBind", "Vale.X64.InsBasic.va_quick_Cpuid_Sha", "Vale.X64.QuickCodes.va_qPURE", "Prims.pure_post", "Prims.l_and", "Prims.l_True", "Prims.l_Forall", "Prims.l_imp", "Prims.b2t", "Prims.op_LessThan", "Prims.pow2", "Prims.l_or", "Prims.eq2", "Prims.int", "Vale.Def.Types_s.iand", "Prims.op_GreaterThan", "Prims.op_GreaterThanOrEqual", "Vale.Arch.TypesNative.lemma_iand_pow2_64", "Vale.X64.InsBasic.va_quick_And64", "Vale.X64.QuickCodes.va_QLemma", "FStar.Pervasives.normalize", "Prims.squash", "Vale.Lib.Basic.assert_normalize", "Vale.X64.QuickCodes.va_QEmpty", "Vale.X64.QuickCodes.quickCodes", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.va_get_reg64", "Vale.X64.State.vale_state", "Vale.X64.QuickCode.va_quickCode", "Vale.Lib.X64.Cpuid.va_code_Check_sha_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_qcode_Check_sha_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ()))
[]
Vale.Lib.X64.Cpuid.va_qcode_Check_sha_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_mods: Vale.X64.QuickCode.va_mods_t -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Lib.X64.Cpuid.va_code_Check_sha_support ())
{ "end_col": 100, "end_line": 179, "start_col": 2, "start_line": 157 }
Prims.Ghost
val va_wpProof_Check_sse_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_sse_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_sse_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
val va_wpProof_Check_sse_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_sse_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_sse_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) let va_wpProof_Check_sse_support va_s0 va_k =
false
null
false
let va_sM, va_f0 = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Lib.X64.Cpuid.va_lemma_Check_sse_support", "Vale.Lib.X64.Cpuid.va_code_Check_sse_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_wpProof_Check_sse_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_sse_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_sse_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[]
Vale.Lib.X64.Cpuid.va_wpProof_Check_sse_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
{ "end_col": 22, "end_line": 719, "start_col": 45, "start_line": 710 }
Prims.Ghost
val va_wpProof_Check_rdrand_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_rdrand_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_rdrand_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_wpProof_Check_rdrand_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
val va_wpProof_Check_rdrand_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_rdrand_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_rdrand_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) let va_wpProof_Check_rdrand_support va_s0 va_k =
false
null
false
let va_sM, va_f0 = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Lib.X64.Cpuid.va_lemma_Check_rdrand_support", "Vale.Lib.X64.Cpuid.va_code_Check_rdrand_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_rdrand_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_rdrand_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_rdrand_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 245 column 36 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> rdrand_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_wpProof_Check_rdrand_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_rdrand_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_rdrand_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[]
Vale.Lib.X64.Cpuid.va_wpProof_Check_rdrand_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
{ "end_col": 22, "end_line": 810, "start_col": 48, "start_line": 801 }
Prims.Ghost
val va_wpProof_Check_osxsave_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_osxsave_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_osxsave_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_wpProof_Check_osxsave_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_osxsave_support (va_code_Check_osxsave_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
val va_wpProof_Check_osxsave_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_osxsave_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_osxsave_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) let va_wpProof_Check_osxsave_support va_s0 va_k =
false
null
false
let va_sM, va_f0 = va_lemma_Check_osxsave_support (va_code_Check_osxsave_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Lib.X64.Cpuid.va_lemma_Check_osxsave_support", "Vale.Lib.X64.Cpuid.va_code_Check_osxsave_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_rdrand_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_rdrand_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_rdrand_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 245 column 36 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> rdrand_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_rdrand_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx512_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx512_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx512_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 277 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx512 ()) (fun (va_s:va_state) _ -> let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg49 16) (let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg48 17) (let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 280 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg47 30) (let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 281 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg46 31) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 284 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 285 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 286 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 288 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 289 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 290 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 292 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (65536 == Prims.pow2 16)) (fun _ -> (fun (p:prop) -> p) (65536 == Prims.pow2 16)) (fun (_:unit) -> assert_normalize (65536 == Prims.pow2 16)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 293 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (131072 == Prims.pow2 17)) (fun _ -> (fun (p:prop) -> p) (131072 == Prims.pow2 17)) (fun (_:unit) -> assert_normalize (131072 == Prims.pow2 17)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 294 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 295 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2147483648 == Prims.pow2 31)) (fun _ -> (fun (p:prop) -> p) (2147483648 == Prims.pow2 31)) (fun (_:unit) -> assert_normalize (2147483648 == Prims.pow2 31)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 297 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 17) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 299 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 301 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 302 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 303 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 14) (let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 305 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg44 va_arg45 16) (let (va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg43 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 307 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 310 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 311 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 312 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 313 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 31) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 15) (let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 316 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg41 va_arg42 16) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (fun (va_s:va_state) _ -> let (va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 318 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg39 va_arg40 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 319 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 321 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx512_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx512_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx512_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 265 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 42 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx512_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx512_support (va_code_Check_avx512_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_osxsave_support [@ "opaque_to_smt" va_qattr] let va_code_Check_osxsave_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Osxsave ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_osxsave_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Osxsave ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_osxsave_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_osxsave_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 332 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 334 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 335 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 336 column 18 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Osxsave ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 337 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 339 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 340 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (134217728 == Prims.pow2 27)) (fun _ -> (fun (p:prop) -> p) (134217728 == Prims.pow2 27)) (fun (_:unit) -> assert_normalize (134217728 == Prims.pow2 27)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 342 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 343 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 27) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 344 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 26) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 346 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_osxsave_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_osxsave_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_osxsave_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 329 column 37 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> osxsave_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 330 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_wpProof_Check_osxsave_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_osxsave_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_osxsave_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[]
Vale.Lib.X64.Cpuid.va_wpProof_Check_osxsave_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
{ "end_col": 22, "end_line": 1086, "start_col": 49, "start_line": 1077 }
Prims.Ghost
val va_wpProof_Check_movbe_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_movbe_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_movbe_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
val va_wpProof_Check_movbe_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_movbe_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_movbe_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) let va_wpProof_Check_movbe_support va_s0 va_k =
false
null
false
let va_sM, va_f0 = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Lib.X64.Cpuid.va_lemma_Check_movbe_support", "Vale.Lib.X64.Cpuid.va_code_Check_movbe_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_wpProof_Check_movbe_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_movbe_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_movbe_support ()) ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[]
Vale.Lib.X64.Cpuid.va_wpProof_Check_movbe_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
{ "end_col": 22, "end_line": 579, "start_col": 47, "start_line": 570 }
Prims.Tot
val va_qcode_Check_avx_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ()))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))
val va_qcode_Check_avx_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) let va_qcode_Check_avx_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) =
false
null
false
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s: va_state) _ -> let va_arg14:Vale.Def.Types_s.nat64 = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s: va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p: prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p: prop) -> p) (268435456 == Prims.pow2 28)) (fun (_: unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s: va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27 ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx ) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Vale.X64.QuickCode.va_mods_t", "Vale.X64.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.X64.Decls.va_code", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_code_Cpuid_Avx", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.InsBasic.va_code_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Prims.Nil", "Vale.X64.Machine_s.precode", "Vale.X64.Decls.ins", "Vale.X64.Decls.ocmp", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.va_QSeq", "Vale.X64.QuickCodes.va_range1", "Vale.X64.InsBasic.va_quick_Mov64", "Vale.X64.QuickCodes.va_QBind", "Vale.X64.InsBasic.va_quick_Cpuid_Avx", "Vale.X64.QuickCodes.va_qPURE", "Prims.pure_post", "Prims.l_and", "Prims.l_True", "Prims.l_Forall", "Prims.l_imp", "Prims.b2t", "Prims.op_LessThan", "Prims.pow2", "Prims.l_or", "Prims.eq2", "Prims.int", "Vale.Def.Types_s.iand", "Prims.op_GreaterThan", "Prims.op_GreaterThanOrEqual", "Vale.Arch.TypesNative.lemma_iand_pow2_64", "Vale.X64.InsBasic.va_quick_And64", "Vale.X64.QuickCodes.va_QLemma", "FStar.Pervasives.normalize", "Prims.squash", "Vale.Lib.Basic.assert_normalize", "Vale.X64.InsBasic.va_quick_Shr64", "Prims.op_LessThanOrEqual", "Vale.Def.Types_s.ishr", "Prims.op_Subtraction", "Vale.Arch.TypesNative.lemma_ishr_pow2_diff64", "Vale.Arch.TypesNative.lemma_ishr_zero64", "Vale.X64.QuickCodes.va_QEmpty", "Vale.X64.QuickCodes.quickCodes", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.va_get_reg64", "Vale.X64.State.vale_state", "Vale.X64.QuickCode.va_quickCode", "Vale.Lib.X64.Cpuid.va_code_Check_avx_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_qcode_Check_avx_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ()))
[]
Vale.Lib.X64.Cpuid.va_qcode_Check_avx_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_mods: Vale.X64.QuickCode.va_mods_t -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Lib.X64.Cpuid.va_code_Check_avx_support ())
{ "end_col": 22, "end_line": 379, "start_col": 2, "start_line": 349 }
Prims.Ghost
val va_wpProof_Check_avx_xcr0_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_avx_xcr0_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_avx_xcr0_support ()) ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_wpProof_Check_avx_xcr0_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_xcr0_support (va_code_Check_avx_xcr0_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
val va_wpProof_Check_avx_xcr0_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_avx_xcr0_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_avx_xcr0_support ()) ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) let va_wpProof_Check_avx_xcr0_support va_s0 va_k =
false
null
false
let va_sM, va_f0 = va_lemma_Check_avx_xcr0_support (va_code_Check_avx_xcr0_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))) ); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRax", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Lib.X64.Cpuid.va_lemma_Check_avx_xcr0_support", "Vale.Lib.X64.Cpuid.va_code_Check_avx_xcr0_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_rdrand_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_rdrand_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_rdrand_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 245 column 36 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> rdrand_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_rdrand_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx512_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx512_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx512_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 277 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx512 ()) (fun (va_s:va_state) _ -> let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg49 16) (let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg48 17) (let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 280 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg47 30) (let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 281 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg46 31) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 284 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 285 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 286 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 288 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 289 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 290 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 292 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (65536 == Prims.pow2 16)) (fun _ -> (fun (p:prop) -> p) (65536 == Prims.pow2 16)) (fun (_:unit) -> assert_normalize (65536 == Prims.pow2 16)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 293 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (131072 == Prims.pow2 17)) (fun _ -> (fun (p:prop) -> p) (131072 == Prims.pow2 17)) (fun (_:unit) -> assert_normalize (131072 == Prims.pow2 17)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 294 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 295 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2147483648 == Prims.pow2 31)) (fun _ -> (fun (p:prop) -> p) (2147483648 == Prims.pow2 31)) (fun (_:unit) -> assert_normalize (2147483648 == Prims.pow2 31)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 297 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 17) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 299 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 301 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 302 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 303 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 14) (let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 305 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg44 va_arg45 16) (let (va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg43 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 307 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 310 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 311 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 312 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 313 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 31) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 15) (let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 316 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg41 va_arg42 16) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (fun (va_s:va_state) _ -> let (va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 318 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg39 va_arg40 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 319 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 321 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx512_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx512_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx512_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 265 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 42 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx512_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx512_support (va_code_Check_avx512_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_osxsave_support [@ "opaque_to_smt" va_qattr] let va_code_Check_osxsave_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Osxsave ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_osxsave_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Osxsave ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_osxsave_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_osxsave_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 332 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 334 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 335 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 336 column 18 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Osxsave ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 337 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 339 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 340 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (134217728 == Prims.pow2 27)) (fun _ -> (fun (p:prop) -> p) (134217728 == Prims.pow2 27)) (fun (_:unit) -> assert_normalize (134217728 == Prims.pow2 27)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 342 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 343 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 27) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 344 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 26) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 346 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_osxsave_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_osxsave_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_osxsave_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 329 column 37 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> osxsave_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 330 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_osxsave_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_osxsave_support (va_code_Check_osxsave_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_xcr0_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_xcr0_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Xgetbv_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_xcr0_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Xgetbv_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_xcr0_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_xcr0_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 358 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 359 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Xgetbv_Avx ()) (fun (va_s:va_state) _ -> let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 360 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg19 1) (let (va_arg18:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 361 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg18 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 362 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 364 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 366 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 367 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4 == Prims.pow2 2)) (fun _ -> (fun (p:prop) -> p) (4 == Prims.pow2 2)) (fun (_:unit) -> assert_normalize (4 == Prims.pow2 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 369 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 370 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 2) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 371 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 373 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg17:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg16:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 374 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg16 va_arg17 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 375 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (()))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_xcr0_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_xcr0_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_xcr0_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 349 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 356 column 30 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_xcr0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_wpProof_Check_avx_xcr0_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_avx_xcr0_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_avx_xcr0_support ()) ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[]
Vale.Lib.X64.Cpuid.va_wpProof_Check_avx_xcr0_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
{ "end_col": 22, "end_line": 1179, "start_col": 50, "start_line": 1171 }
Prims.Tot
val va_qcode_Check_avx2_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ()))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))
val va_qcode_Check_avx2_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) let va_qcode_Check_avx2_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) =
false
null
false
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s: va_state) _ -> let va_arg11:Vale.Def.Types_s.nat64 = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s: va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p: prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p: prop) -> p) (32 == Prims.pow2 5)) (fun (_: unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Vale.X64.QuickCode.va_mods_t", "Vale.X64.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.X64.Decls.va_code", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRcx", "Vale.X64.InsBasic.va_code_Cpuid_Avx2", "Vale.X64.InsBasic.va_code_And64", "Prims.Nil", "Vale.X64.Machine_s.precode", "Vale.X64.Decls.ins", "Vale.X64.Decls.ocmp", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.va_QSeq", "Vale.X64.QuickCodes.va_range1", "Vale.X64.InsBasic.va_quick_Mov64", "Vale.X64.QuickCodes.va_QBind", "Vale.X64.InsBasic.va_quick_Cpuid_Avx2", "Vale.X64.QuickCodes.va_qPURE", "Prims.pure_post", "Prims.l_and", "Prims.l_True", "Prims.l_Forall", "Prims.l_imp", "Prims.b2t", "Prims.op_LessThan", "Prims.pow2", "Prims.l_or", "Prims.eq2", "Prims.int", "Vale.Def.Types_s.iand", "Prims.op_GreaterThan", "Prims.op_GreaterThanOrEqual", "Vale.Arch.TypesNative.lemma_iand_pow2_64", "Vale.X64.InsBasic.va_quick_And64", "Vale.X64.QuickCodes.va_QLemma", "FStar.Pervasives.normalize", "Prims.squash", "Vale.Lib.Basic.assert_normalize", "Vale.X64.QuickCodes.va_QEmpty", "Vale.X64.QuickCodes.quickCodes", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.va_get_reg64", "Vale.X64.State.vale_state", "Vale.X64.QuickCode.va_quickCode", "Vale.Lib.X64.Cpuid.va_code_Check_avx2_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_qcode_Check_avx2_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ()))
[]
Vale.Lib.X64.Cpuid.va_qcode_Check_avx2_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_mods: Vale.X64.QuickCode.va_mods_t -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Lib.X64.Cpuid.va_code_Check_avx2_support ())
{ "end_col": 100, "end_line": 458, "start_col": 2, "start_line": 437 }
Prims.Ghost
val va_lemma_Check_avx_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_avx_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
val va_lemma_Check_avx_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_avx_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))) let va_lemma_Check_avx_support va_b0 va_s0 =
false
null
false
let va_mods:va_mods_t = [ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok ] in let va_qc = va_qcode_Check_avx_support va_mods in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Lib.X64.Cpuid.va_code_Check_avx_support", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.l_imp", "Prims.l_not", "Prims.int", "Vale.X64.Decls.va_get_reg64", "Vale.X64.CPU_Features_s.avx_cpuid_enabled", "Vale.Def.Types_s.nat64", "Vale.X64.QuickCode.quickCode", "Vale.Lib.X64.Cpuid.va_qcode_Check_avx_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_lemma_Check_avx_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_avx_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))
[]
Vale.Lib.X64.Cpuid.va_lemma_Check_avx_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
{ "end_col": 16, "end_line": 397, "start_col": 44, "start_line": 382 }
Prims.Ghost
val va_wpProof_Check_avx512_xcr0_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_avx512_xcr0_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_avx512_xcr0_support ()) ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_wpProof_Check_avx512_xcr0_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx512_xcr0_support (va_code_Check_avx512_xcr0_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
val va_wpProof_Check_avx512_xcr0_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_avx512_xcr0_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_avx512_xcr0_support ()) ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) let va_wpProof_Check_avx512_xcr0_support va_s0 va_k =
false
null
false
let va_sM, va_f0 = va_lemma_Check_avx512_xcr0_support (va_code_Check_avx512_xcr0_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))) ); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRax", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Lib.X64.Cpuid.va_lemma_Check_avx512_xcr0_support", "Vale.Lib.X64.Cpuid.va_code_Check_avx512_xcr0_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_rdrand_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_rdrand_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_rdrand_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 245 column 36 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> rdrand_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_rdrand_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx512_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx512_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx512_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 277 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx512 ()) (fun (va_s:va_state) _ -> let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg49 16) (let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg48 17) (let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 280 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg47 30) (let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 281 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg46 31) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 284 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 285 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 286 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 288 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 289 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 290 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 292 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (65536 == Prims.pow2 16)) (fun _ -> (fun (p:prop) -> p) (65536 == Prims.pow2 16)) (fun (_:unit) -> assert_normalize (65536 == Prims.pow2 16)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 293 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (131072 == Prims.pow2 17)) (fun _ -> (fun (p:prop) -> p) (131072 == Prims.pow2 17)) (fun (_:unit) -> assert_normalize (131072 == Prims.pow2 17)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 294 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 295 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2147483648 == Prims.pow2 31)) (fun _ -> (fun (p:prop) -> p) (2147483648 == Prims.pow2 31)) (fun (_:unit) -> assert_normalize (2147483648 == Prims.pow2 31)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 297 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 17) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 299 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 301 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 302 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 303 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 14) (let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 305 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg44 va_arg45 16) (let (va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg43 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 307 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 310 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 311 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 312 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 313 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 31) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 15) (let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 316 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg41 va_arg42 16) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (fun (va_s:va_state) _ -> let (va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 318 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg39 va_arg40 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 319 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 321 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx512_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx512_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx512_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 265 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 42 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx512_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx512_support (va_code_Check_avx512_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_osxsave_support [@ "opaque_to_smt" va_qattr] let va_code_Check_osxsave_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Osxsave ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_osxsave_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Osxsave ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_osxsave_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_osxsave_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 332 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 334 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 335 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 336 column 18 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Osxsave ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 337 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 339 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 340 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (134217728 == Prims.pow2 27)) (fun _ -> (fun (p:prop) -> p) (134217728 == Prims.pow2 27)) (fun (_:unit) -> assert_normalize (134217728 == Prims.pow2 27)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 342 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 343 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 27) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 344 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 26) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 346 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_osxsave_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_osxsave_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_osxsave_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 329 column 37 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> osxsave_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 330 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_osxsave_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_osxsave_support (va_code_Check_osxsave_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_xcr0_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_xcr0_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Xgetbv_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_xcr0_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Xgetbv_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_xcr0_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_xcr0_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 358 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 359 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Xgetbv_Avx ()) (fun (va_s:va_state) _ -> let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 360 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg19 1) (let (va_arg18:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 361 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg18 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 362 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 364 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 366 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 367 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4 == Prims.pow2 2)) (fun _ -> (fun (p:prop) -> p) (4 == Prims.pow2 2)) (fun (_:unit) -> assert_normalize (4 == Prims.pow2 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 369 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 370 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 2) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 371 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 373 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg17:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg16:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 374 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg16 va_arg17 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 375 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (()))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_xcr0_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_xcr0_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_xcr0_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 349 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 356 column 30 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_xcr0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_xcr0_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_xcr0_support (va_code_Check_avx_xcr0_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_xcr0_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_xcr0_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Xgetbv_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 32)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 64)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 128)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 2)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRcx) (va_const_shift_amt64 1)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx512_xcr0_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Xgetbv_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 64)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 128)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 2)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRcx) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx512_xcr0_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx512_xcr0_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 389 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 390 column 18 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Xgetbv_Avx512 ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 392 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 393 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 395 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 5) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 396 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg32 6) (let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 397 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg31 7) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 399 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 32)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 400 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 64)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 401 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 128)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 403 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 404 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (64 == Prims.pow2 6)) (fun _ -> (fun (p:prop) -> p) (64 == Prims.pow2 6)) (fun (_:unit) -> assert_normalize (64 == Prims.pow2 6)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 405 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (128 == Prims.pow2 7)) (fun _ -> (fun (p:prop) -> p) (128 == Prims.pow2 7)) (fun (_:unit) -> assert_normalize (128 == Prims.pow2 7)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 407 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 2)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 408 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 5 7) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 409 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 2) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 411 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRcx) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 412 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 5 6) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 413 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 415 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg29 va_arg30 5) (let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 416 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg28 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 417 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg27:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg26:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 418 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg26 va_arg27 5) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 419 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (()))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx512_xcr0_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx512_xcr0_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx512_xcr0_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 379 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 387 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_xcr0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_wpProof_Check_avx512_xcr0_support : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Check_avx512_xcr0_support va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Check_avx512_xcr0_support ()) ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
[]
Vale.Lib.X64.Cpuid.va_wpProof_Check_avx512_xcr0_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
{ "end_col": 22, "end_line": 1307, "start_col": 53, "start_line": 1298 }
Prims.Tot
val va_qcode_Check_movbe_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ()))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))
val va_qcode_Check_movbe_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) let va_qcode_Check_movbe_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) =
false
null
false
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s: va_state) _ -> let va_arg14:Vale.Def.Types_s.nat64 = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s: va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p: prop) -> normalize p) (4194304 == Prims.pow2 22) ) (fun _ -> (fun (p: prop) -> p) (4194304 == Prims.pow2 22)) (fun (_: unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s: va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21 ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx ) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Vale.X64.QuickCode.va_mods_t", "Vale.X64.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.X64.Decls.va_code", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_code_Cpuid_Movbe", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.InsBasic.va_code_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Prims.Nil", "Vale.X64.Machine_s.precode", "Vale.X64.Decls.ins", "Vale.X64.Decls.ocmp", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.va_QSeq", "Vale.X64.QuickCodes.va_range1", "Vale.X64.InsBasic.va_quick_Mov64", "Vale.X64.QuickCodes.va_QBind", "Vale.X64.InsBasic.va_quick_Cpuid_Movbe", "Vale.X64.QuickCodes.va_qPURE", "Prims.pure_post", "Prims.l_and", "Prims.l_True", "Prims.l_Forall", "Prims.l_imp", "Prims.b2t", "Prims.op_LessThan", "Prims.pow2", "Prims.l_or", "Prims.eq2", "Prims.int", "Vale.Def.Types_s.iand", "Prims.op_GreaterThan", "Prims.op_GreaterThanOrEqual", "Vale.Arch.TypesNative.lemma_iand_pow2_64", "Vale.X64.InsBasic.va_quick_And64", "Vale.X64.QuickCodes.va_QLemma", "FStar.Pervasives.normalize", "Prims.squash", "Vale.Lib.Basic.assert_normalize", "Vale.X64.InsBasic.va_quick_Shr64", "Prims.op_LessThanOrEqual", "Vale.Def.Types_s.ishr", "Prims.op_Subtraction", "Vale.Arch.TypesNative.lemma_ishr_pow2_diff64", "Vale.Arch.TypesNative.lemma_ishr_zero64", "Vale.X64.QuickCodes.va_QEmpty", "Vale.X64.QuickCodes.quickCodes", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.va_get_reg64", "Vale.X64.State.vale_state", "Vale.X64.QuickCode.va_quickCode", "Vale.Lib.X64.Cpuid.va_code_Check_movbe_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_qcode_Check_movbe_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ()))
[]
Vale.Lib.X64.Cpuid.va_qcode_Check_movbe_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_mods: Vale.X64.QuickCode.va_mods_t -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Lib.X64.Cpuid.va_code_Check_movbe_support ())
{ "end_col": 22, "end_line": 548, "start_col": 2, "start_line": 518 }
Prims.Ghost
val va_lemma_Check_sse_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_sse_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
val va_lemma_Check_sse_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_sse_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))) let va_lemma_Check_sse_support va_b0 va_s0 =
false
null
false
let va_mods:va_mods_t = [ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok ] in let va_qc = va_qcode_Check_sse_support va_mods in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Lib.X64.Cpuid.va_code_Check_sse_support", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.l_imp", "Prims.l_not", "Prims.int", "Vale.X64.Decls.va_get_reg64", "Vale.X64.CPU_Features_s.sse_enabled", "Vale.Def.Types_s.nat64", "Vale.X64.QuickCode.quickCode", "Vale.Lib.X64.Cpuid.va_qcode_Check_sse_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))))))))))))
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_lemma_Check_sse_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_sse_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))
[]
Vale.Lib.X64.Cpuid.va_lemma_Check_sse_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
{ "end_col": 16, "end_line": 706, "start_col": 44, "start_line": 691 }
Prims.Ghost
val va_lemma_Check_movbe_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_movbe_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
val va_lemma_Check_movbe_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_movbe_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))) let va_lemma_Check_movbe_support va_b0 va_s0 =
false
null
false
let va_mods:va_mods_t = [ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok ] in let va_qc = va_qcode_Check_movbe_support va_mods in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Lib.X64.Cpuid.va_code_Check_movbe_support", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.l_imp", "Prims.l_not", "Prims.int", "Vale.X64.Decls.va_get_reg64", "Vale.X64.CPU_Features_s.movbe_enabled", "Vale.Def.Types_s.nat64", "Vale.X64.QuickCode.quickCode", "Vale.Lib.X64.Cpuid.va_qcode_Check_movbe_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_lemma_Check_movbe_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_movbe_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))
[]
Vale.Lib.X64.Cpuid.va_lemma_Check_movbe_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
{ "end_col": 16, "end_line": 566, "start_col": 46, "start_line": 551 }
Prims.Ghost
val va_lemma_Check_avx512_xcr0_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_avx512_xcr0_support ()) va_s0 /\ va_get_ok va_s0 /\ osxsave_enabled /\ avx_xcr0)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM =!= 0 ==> avx512_xcr0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_lemma_Check_avx512_xcr0_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx512_xcr0_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx512_xcr0_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 379 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 387 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_xcr0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
val va_lemma_Check_avx512_xcr0_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_avx512_xcr0_support ()) va_s0 /\ va_get_ok va_s0 /\ osxsave_enabled /\ avx_xcr0)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM =!= 0 ==> avx512_xcr0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))) let va_lemma_Check_avx512_xcr0_support va_b0 va_s0 =
false
null
false
let va_mods:va_mods_t = [va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx512_xcr0_support va_mods in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Check_avx512_xcr0_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 379 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 387 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_xcr0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Lib.X64.Cpuid.va_code_Check_avx512_xcr0_support", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.l_imp", "Prims.l_not", "Prims.int", "Vale.X64.Decls.va_get_reg64", "Vale.X64.CPU_Features_s.avx512_xcr0", "Vale.X64.QuickCode.quickCode", "Vale.Lib.X64.Cpuid.va_qcode_Check_avx512_xcr0_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_rdrand_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_rdrand_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_rdrand_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 245 column 36 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> rdrand_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_rdrand_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx512_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx512_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx512_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 277 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx512 ()) (fun (va_s:va_state) _ -> let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg49 16) (let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg48 17) (let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 280 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg47 30) (let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 281 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg46 31) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 284 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 285 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 286 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 288 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 289 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 290 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 292 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (65536 == Prims.pow2 16)) (fun _ -> (fun (p:prop) -> p) (65536 == Prims.pow2 16)) (fun (_:unit) -> assert_normalize (65536 == Prims.pow2 16)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 293 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (131072 == Prims.pow2 17)) (fun _ -> (fun (p:prop) -> p) (131072 == Prims.pow2 17)) (fun (_:unit) -> assert_normalize (131072 == Prims.pow2 17)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 294 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 295 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2147483648 == Prims.pow2 31)) (fun _ -> (fun (p:prop) -> p) (2147483648 == Prims.pow2 31)) (fun (_:unit) -> assert_normalize (2147483648 == Prims.pow2 31)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 297 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 17) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 299 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 301 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 302 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 303 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 14) (let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 305 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg44 va_arg45 16) (let (va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg43 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 307 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 310 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 311 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 312 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 313 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 31) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 15) (let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 316 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg41 va_arg42 16) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (fun (va_s:va_state) _ -> let (va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 318 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg39 va_arg40 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 319 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 321 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx512_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx512_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx512_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 265 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 42 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx512_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx512_support (va_code_Check_avx512_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_osxsave_support [@ "opaque_to_smt" va_qattr] let va_code_Check_osxsave_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Osxsave ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_osxsave_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Osxsave ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_osxsave_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_osxsave_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 332 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 334 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 335 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 336 column 18 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Osxsave ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 337 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 339 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 340 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (134217728 == Prims.pow2 27)) (fun _ -> (fun (p:prop) -> p) (134217728 == Prims.pow2 27)) (fun (_:unit) -> assert_normalize (134217728 == Prims.pow2 27)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 342 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 343 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 27) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 344 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 26) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 346 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_osxsave_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_osxsave_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_osxsave_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 324 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 329 column 37 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> osxsave_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 330 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_osxsave_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_osxsave_support (va_code_Check_osxsave_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_xcr0_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_xcr0_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Xgetbv_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_xcr0_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Xgetbv_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_xcr0_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_xcr0_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 358 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 359 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Xgetbv_Avx ()) (fun (va_s:va_state) _ -> let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 360 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg19 1) (let (va_arg18:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 361 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg18 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 362 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 364 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 366 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 367 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4 == Prims.pow2 2)) (fun _ -> (fun (p:prop) -> p) (4 == Prims.pow2 2)) (fun (_:unit) -> assert_normalize (4 == Prims.pow2 2)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 369 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 370 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 2) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 371 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 373 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg17:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg16:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 374 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg16 va_arg17 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 375 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (()))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_xcr0_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_xcr0_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_xcr0_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 349 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 356 column 30 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_xcr0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_xcr0_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_xcr0_support (va_code_Check_avx_xcr0_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_xcr0_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_xcr0_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Xgetbv_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 32)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 64)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 128)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 2)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRcx) (va_const_shift_amt64 1)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx512_xcr0_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Xgetbv_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 64)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 128)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 2)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRcx) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx512_xcr0_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx512_xcr0_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 389 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 390 column 18 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Xgetbv_Avx512 ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 392 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRax)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 393 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 395 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 5) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 396 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg32 6) (let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 397 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg31 7) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 399 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 32)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 400 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 64)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 401 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 128)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 403 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 404 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (64 == Prims.pow2 6)) (fun _ -> (fun (p:prop) -> p) (64 == Prims.pow2 6)) (fun (_:unit) -> assert_normalize (64 == Prims.pow2 6)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 405 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (128 == Prims.pow2 7)) (fun _ -> (fun (p:prop) -> p) (128 == Prims.pow2 7)) (fun (_:unit) -> assert_normalize (128 == Prims.pow2 7)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 407 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 2)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 408 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 5 7) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 409 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 2) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 411 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRcx) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 412 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 5 6) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 413 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 415 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg29 va_arg30 5) (let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 416 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg28 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 417 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg27:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg26:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 418 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg26 va_arg27 5) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 419 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))))))))))))))))
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_lemma_Check_avx512_xcr0_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_avx512_xcr0_support ()) va_s0 /\ va_get_ok va_s0 /\ osxsave_enabled /\ avx_xcr0)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM =!= 0 ==> avx512_xcr0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))
[]
Vale.Lib.X64.Cpuid.va_lemma_Check_avx512_xcr0_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
{ "end_col": 16, "end_line": 1294, "start_col": 52, "start_line": 1281 }
Prims.Tot
val va_qcode_Check_rdrand_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ()))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))
val va_qcode_Check_rdrand_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) let va_qcode_Check_rdrand_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) =
false
null
false
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s: va_state) _ -> let va_arg14:Vale.Def.Types_s.nat64 = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s: va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p: prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p: prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_: unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s: va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29 ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx ) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Vale.X64.QuickCode.va_mods_t", "Vale.X64.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.X64.Decls.va_code", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_code_Cpuid_Rdrand", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.InsBasic.va_code_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Prims.Nil", "Vale.X64.Machine_s.precode", "Vale.X64.Decls.ins", "Vale.X64.Decls.ocmp", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.va_QSeq", "Vale.X64.QuickCodes.va_range1", "Vale.X64.InsBasic.va_quick_Mov64", "Vale.X64.QuickCodes.va_QBind", "Vale.X64.InsBasic.va_quick_Cpuid_Rdrand", "Vale.X64.QuickCodes.va_qPURE", "Prims.pure_post", "Prims.l_and", "Prims.l_True", "Prims.l_Forall", "Prims.l_imp", "Prims.b2t", "Prims.op_LessThan", "Prims.pow2", "Prims.l_or", "Prims.eq2", "Prims.int", "Vale.Def.Types_s.iand", "Prims.op_GreaterThan", "Prims.op_GreaterThanOrEqual", "Vale.Arch.TypesNative.lemma_iand_pow2_64", "Vale.X64.InsBasic.va_quick_And64", "Vale.X64.QuickCodes.va_QLemma", "FStar.Pervasives.normalize", "Prims.squash", "Vale.Lib.Basic.assert_normalize", "Vale.X64.InsBasic.va_quick_Shr64", "Prims.op_LessThanOrEqual", "Vale.Def.Types_s.ishr", "Prims.op_Subtraction", "Vale.Arch.TypesNative.lemma_ishr_pow2_diff64", "Vale.Arch.TypesNative.lemma_ishr_zero64", "Vale.X64.QuickCodes.va_QEmpty", "Vale.X64.QuickCodes.quickCodes", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.va_get_reg64", "Vale.X64.State.vale_state", "Vale.X64.QuickCode.va_quickCode", "Vale.Lib.X64.Cpuid.va_code_Check_rdrand_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_qcode_Check_rdrand_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ()))
[]
Vale.Lib.X64.Cpuid.va_qcode_Check_rdrand_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_mods: Vale.X64.QuickCode.va_mods_t -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Lib.X64.Cpuid.va_code_Check_rdrand_support ())
{ "end_col": 22, "end_line": 779, "start_col": 2, "start_line": 749 }
Prims.Tot
val va_qcode_Check_osxsave_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_osxsave_support ()))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_qcode_Check_osxsave_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_osxsave_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 332 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 334 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 335 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 336 column 18 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Osxsave ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 337 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 339 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 340 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (134217728 == Prims.pow2 27)) (fun _ -> (fun (p:prop) -> p) (134217728 == Prims.pow2 27)) (fun (_:unit) -> assert_normalize (134217728 == Prims.pow2 27)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 342 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 343 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 27) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 344 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 26) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 346 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))
val va_qcode_Check_osxsave_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_osxsave_support ())) let va_qcode_Check_osxsave_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_osxsave_support ())) =
false
null
false
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 332 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 334 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 335 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 336 column 18 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Osxsave ()) (fun (va_s: va_state) _ -> let va_arg14:Vale.Def.Types_s.nat64 = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 337 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 338 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 339 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (fun (va_s: va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 340 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p: prop) -> normalize p) (134217728 == Prims.pow2 27)) (fun _ -> (fun (p: prop) -> p) (134217728 == Prims.pow2 27)) (fun (_: unit) -> assert_normalize (134217728 == Prims.pow2 27)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 342 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (fun (va_s: va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 343 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 27) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 344 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 26 ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 346 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx ) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Vale.X64.QuickCode.va_mods_t", "Vale.X64.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.X64.Decls.va_code", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_code_Cpuid_Osxsave", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.InsBasic.va_code_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Prims.Nil", "Vale.X64.Machine_s.precode", "Vale.X64.Decls.ins", "Vale.X64.Decls.ocmp", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.va_QSeq", "Vale.X64.QuickCodes.va_range1", "Vale.X64.InsBasic.va_quick_Mov64", "Vale.X64.QuickCodes.va_QBind", "Vale.X64.InsBasic.va_quick_Cpuid_Osxsave", "Vale.X64.QuickCodes.va_qPURE", "Prims.pure_post", "Prims.l_and", "Prims.l_True", "Prims.l_Forall", "Prims.l_imp", "Prims.b2t", "Prims.op_LessThan", "Prims.pow2", "Prims.l_or", "Prims.eq2", "Prims.int", "Vale.Def.Types_s.iand", "Prims.op_GreaterThan", "Prims.op_GreaterThanOrEqual", "Vale.Arch.TypesNative.lemma_iand_pow2_64", "Vale.X64.InsBasic.va_quick_And64", "Vale.X64.QuickCodes.va_QLemma", "FStar.Pervasives.normalize", "Prims.squash", "Vale.Lib.Basic.assert_normalize", "Vale.X64.InsBasic.va_quick_Shr64", "Prims.op_LessThanOrEqual", "Vale.Def.Types_s.ishr", "Prims.op_Subtraction", "Vale.Arch.TypesNative.lemma_ishr_pow2_diff64", "Vale.Arch.TypesNative.lemma_ishr_zero64", "Vale.X64.QuickCodes.va_QEmpty", "Vale.X64.QuickCodes.quickCodes", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.va_get_reg64", "Vale.X64.State.vale_state", "Vale.X64.QuickCode.va_quickCode", "Vale.Lib.X64.Cpuid.va_code_Check_osxsave_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_rdrand_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_rdrand_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_rdrand_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 245 column 36 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> rdrand_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_rdrand_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx512_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx512_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx512_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 277 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx512 ()) (fun (va_s:va_state) _ -> let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg49 16) (let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg48 17) (let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 280 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg47 30) (let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 281 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg46 31) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 284 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 285 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 286 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 288 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 289 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 290 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 292 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (65536 == Prims.pow2 16)) (fun _ -> (fun (p:prop) -> p) (65536 == Prims.pow2 16)) (fun (_:unit) -> assert_normalize (65536 == Prims.pow2 16)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 293 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (131072 == Prims.pow2 17)) (fun _ -> (fun (p:prop) -> p) (131072 == Prims.pow2 17)) (fun (_:unit) -> assert_normalize (131072 == Prims.pow2 17)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 294 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 295 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2147483648 == Prims.pow2 31)) (fun _ -> (fun (p:prop) -> p) (2147483648 == Prims.pow2 31)) (fun (_:unit) -> assert_normalize (2147483648 == Prims.pow2 31)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 297 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 17) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 299 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 301 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 302 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 303 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 14) (let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 305 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg44 va_arg45 16) (let (va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg43 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 307 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 310 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 311 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 312 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 313 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 31) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 15) (let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 316 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg41 va_arg42 16) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (fun (va_s:va_state) _ -> let (va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 318 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg39 va_arg40 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 319 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 321 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx512_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx512_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx512_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 265 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 42 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx512_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx512_support (va_code_Check_avx512_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_osxsave_support [@ "opaque_to_smt" va_qattr] let va_code_Check_osxsave_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Osxsave ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_osxsave_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Osxsave ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 134217728)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 26)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_osxsave_support (va_mods:va_mods_t) : (va_quickCode unit
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_qcode_Check_osxsave_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_osxsave_support ()))
[]
Vale.Lib.X64.Cpuid.va_qcode_Check_osxsave_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_mods: Vale.X64.QuickCode.va_mods_t -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Lib.X64.Cpuid.va_code_Check_osxsave_support ())
{ "end_col": 22, "end_line": 1055, "start_col": 2, "start_line": 1025 }
Prims.Tot
val va_qcode_Check_aesni_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ()))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))
val va_qcode_Check_aesni_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) let va_qcode_Check_aesni_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) =
false
null
false
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s: va_state) _ -> let va_arg22:Vale.Def.Types_s.nat64 = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let va_arg21:Vale.Def.Types_s.nat64 = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s: va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p: prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p: prop) -> p) (33554432 == Prims.pow2 25)) (fun (_: unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p: prop) -> normalize p) (2 == Prims.pow2 1 )) (fun _ -> (fun (p: prop) -> p) (2 == Prims.pow2 1) ) (fun (_: unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s: va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s: va_state) _ -> let va_arg20:Vale.Def.Types_s.nat64 = va_get_reg64 rRcx va_s in let va_arg19:Vale.Def.Types_s.nat64 = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_: unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))) ))))))))))))))))
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[ "total" ]
[ "Vale.X64.QuickCode.va_mods_t", "Vale.X64.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.X64.Decls.va_code", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR9", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_const_opr64", "Vale.X64.Machine_s.rRax", "Vale.X64.InsBasic.va_code_Cpuid_AES", "Vale.X64.InsBasic.va_code_And64", "Vale.X64.InsBasic.va_code_Shr64", "Vale.X64.Decls.va_const_shift_amt64", "Prims.Nil", "Vale.X64.Machine_s.precode", "Vale.X64.Decls.ins", "Vale.X64.Decls.ocmp", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.va_QSeq", "Vale.X64.QuickCodes.va_range1", "Vale.X64.InsBasic.va_quick_Mov64", "Vale.X64.QuickCodes.va_QBind", "Vale.X64.InsBasic.va_quick_Cpuid_AES", "Vale.X64.QuickCodes.va_qPURE", "Prims.pure_post", "Prims.l_and", "Prims.l_True", "Prims.l_Forall", "Prims.l_imp", "Prims.b2t", "Prims.op_LessThan", "Prims.pow2", "Prims.l_or", "Prims.eq2", "Prims.int", "Vale.Def.Types_s.iand", "Prims.op_GreaterThan", "Prims.op_GreaterThanOrEqual", "Vale.Arch.TypesNative.lemma_iand_pow2_64", "Vale.X64.InsBasic.va_quick_And64", "Vale.X64.QuickCodes.va_QLemma", "FStar.Pervasives.normalize", "Prims.squash", "Vale.Lib.Basic.assert_normalize", "Vale.X64.InsBasic.va_quick_Shr64", "Prims.op_LessThanOrEqual", "Vale.Def.Types_s.ishr", "Prims.op_Subtraction", "Vale.Arch.TypesNative.lemma_ishr_pow2_diff64", "Vale.Arch.TypesNative.lemma_ishr_zero64", "Prims.l_iff", "Prims.op_Negation", "Prims.op_Equality", "Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64", "Vale.X64.QuickCodes.va_QEmpty", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.va_get_reg64", "Vale.X64.QuickCodes.quickCodes", "Vale.X64.State.vale_state", "Vale.X64.QuickCode.va_quickCode", "Vale.Lib.X64.Cpuid.va_code_Check_aesni_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_qcode_Check_aesni_support (va_mods: va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ()))
[]
Vale.Lib.X64.Cpuid.va_qcode_Check_aesni_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_mods: Vale.X64.QuickCode.va_mods_t -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Lib.X64.Cpuid.va_code_Check_aesni_support ())
{ "end_col": 27, "end_line": 98, "start_col": 2, "start_line": 53 }
Prims.Ghost
val va_lemma_Check_avx512_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_avx512_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))
[ { "abbrev": false, "full_module": "Vale.Lib.Basic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Lib.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let va_lemma_Check_avx512_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx512_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx512_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 265 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 42 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
val va_lemma_Check_avx512_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_avx512_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))) let va_lemma_Check_avx512_support va_b0 va_s0 =
false
null
false
let va_mods:va_mods_t = [ va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok ] in let va_qc = va_qcode_Check_avx512_support va_mods in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Check_avx512_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 265 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 270 column 42 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 271 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "Vale.Lib.X64.Cpuid.fst.checked", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Lib.Basic.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.Arch.TypesNative.fsti.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Lib.X64.Cpuid.fst" }
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Lib.X64.Cpuid.va_code_Check_avx512_support", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.l_imp", "Prims.l_not", "Prims.int", "Vale.X64.Decls.va_get_reg64", "Vale.X64.CPU_Features_s.avx512_cpuid_enabled", "Vale.Def.Types_s.nat64", "Vale.X64.QuickCode.quickCode", "Vale.Lib.X64.Cpuid.va_qcode_Check_avx512_support" ]
[]
module Vale.Lib.X64.Cpuid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.QuickCode open Vale.X64.QuickCodes open Vale.X64.CPU_Features_s //let pow2_values (u:unit) : Lemma // (pow2 29 == 0x20000000 /\ // pow2 25 == 0x2000000 /\ // pow2 1 == 0x2) // = // assert_norm (pow2 29 == 0x20000000); // assert_norm (0x2000000 == pow2 25); // assert_norm (0x2 == pow2 1); // () open Vale.Lib.Basic //-- Check_aesni_support [@ "opaque_to_smt" va_qattr] let va_code_Check_aesni_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_AES ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_aesni_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_AES ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_aesni_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_aesni_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 42 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 44 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 45 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 46 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_AES ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 47 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 25) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 48 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 49 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 50 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 33554432)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 51 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (33554432 == Prims.pow2 25)) (fun _ -> (fun (p:prop) -> p) (33554432 == Prims.pow2 25)) (fun (_:unit) -> assert_normalize (33554432 == Prims.pow2 25)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 52 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2 == Prims.pow2 1)) (fun _ -> (fun (p:prop) -> p) (2 == Prims.pow2 1)) (fun (_:unit) -> assert_normalize (2 == Prims.pow2 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 54 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 24)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 55 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 25) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 56 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 24) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 58 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 2)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 59 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 60 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 66 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_aesni_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_aesni_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_aesni_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 34 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 39 column 56 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> aesni_enabled /\ pclmulqdq_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 40 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_aesni_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_aesni_support (va_code_Check_aesni_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sha_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sha_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Sha ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sha_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Sha ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sha_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sha_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 77 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 79 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 80 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 81 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sha ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 82 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 29) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 83 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 536870912)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 84 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (536870912 == Prims.pow2 29)) (fun _ -> (fun (p:prop) -> p) (536870912 == Prims.pow2 29)) (fun (_:unit) -> assert_normalize (536870912 == Prims.pow2 29)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 85 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 87 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sha_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sha_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sha_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 69 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 74 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sha_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 75 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sha_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sha_support (va_code_Check_sha_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_adx_bmi2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_adx_bmi2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Adx_Bmi2 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_adx_bmi2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Adx_Bmi2 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_adx_bmi2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_adx_bmi2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 98 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 100 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 19 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Adx_Bmi2 ()) (fun (va_s:va_state) _ -> let (va_arg22:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 103 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg22 8) (let (va_arg21:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg21 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 107 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (256 == Prims.pow2 8)) (fun _ -> (fun (p:prop) -> p) (256 == Prims.pow2 8)) (fun (_:unit) -> assert_normalize (256 == Prims.pow2 8)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 110 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 112 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 11)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 113 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 8 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 114 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 11) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 116 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 256)) (fun (va_s:va_state) _ -> let (va_arg20:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg19:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg19 va_arg20 8) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 118 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 120 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_adx_bmi2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_adx_bmi2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_adx_bmi2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 90 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 49 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> adx_enabled /\ bmi2_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_adx_bmi2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_adx_bmi2_support (va_code_Check_adx_bmi2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Avx ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Avx ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 131 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 133 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 134 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 135 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 136 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 25) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 137 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 138 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 268435456)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 139 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (268435456 == Prims.pow2 28)) (fun _ -> (fun (p:prop) -> p) (268435456 == Prims.pow2 28)) (fun (_:unit) -> assert_normalize (268435456 == Prims.pow2 28)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 141 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 27)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 142 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 28) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 143 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 27) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 145 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 123 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 128 column 39 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 129 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx_support (va_code_Check_avx_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx2_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx2_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx2 ()) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx2_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx2 ()) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx2_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx2_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 156 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 158 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 159 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 160 column 15 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx2 ()) (fun (va_s:va_state) _ -> let (va_arg11:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 161 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg11 5) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 162 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 32)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 163 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (32 == Prims.pow2 5)) (fun _ -> (fun (p:prop) -> p) (32 == Prims.pow2 5)) (fun (_:unit) -> assert_normalize (32 == Prims.pow2 5)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 164 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 166 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Check_avx2_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_avx2_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_avx2_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 148 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 153 column 40 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> avx2_cpuid_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 154 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_avx2_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_avx2_support (va_code_Check_avx2_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_movbe_support [@ "opaque_to_smt" va_qattr] let va_code_Check_movbe_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Movbe ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_movbe_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Movbe ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_movbe_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_movbe_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 177 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 179 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 180 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 181 column 16 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Movbe ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 182 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 22) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 183 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 184 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 4194304)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 185 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (4194304 == Prims.pow2 22)) (fun _ -> (fun (p:prop) -> p) (4194304 == Prims.pow2 22)) (fun (_:unit) -> assert_normalize (4194304 == Prims.pow2 22)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 187 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 21)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 188 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 22) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 189 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 21) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 191 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_movbe_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_movbe_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_movbe_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 169 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 174 column 35 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> movbe_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 175 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_movbe_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_movbe_support (va_code_Check_movbe_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_sse_support [@ "opaque_to_smt" va_qattr] let va_code_Check_sse_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Sse ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_sse_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Sse ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_sse_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_sse_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 202 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 204 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 205 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 206 column 14 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Sse ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 209 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 211 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg35 9) (let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 212 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg34 26) (let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 213 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg33 19) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 215 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 524288)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 512)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 67108864)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 219 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (512 == Prims.pow2 9)) (fun _ -> (fun (p:prop) -> p) (512 == Prims.pow2 9)) (fun (_:unit) -> assert_normalize (512 == Prims.pow2 9)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 220 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (524288 == Prims.pow2 19)) (fun _ -> (fun (p:prop) -> p) (524288 == Prims.pow2 19)) (fun (_:unit) -> assert_normalize (524288 == Prims.pow2 19)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 221 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (67108864 == Prims.pow2 26)) (fun _ -> (fun (p:prop) -> p) (67108864 == Prims.pow2 26)) (fun (_:unit) -> assert_normalize (67108864 == Prims.pow2 26)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 223 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 10)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 224 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 19) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 225 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 10) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 227 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRdx) (va_const_shift_amt64 17)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 228 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 9 26) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 229 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 17) (let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 231 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg31 va_arg32 9) (let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 232 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg30 9) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (fun (va_s:va_state) _ -> let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 234 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg28 va_arg29 9) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_sse_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_sse_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_sse_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 194 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 199 column 33 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> sse_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 200 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_sse_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_sse_support (va_code_Check_sse_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_rdrand_support [@ "opaque_to_smt" va_qattr] let va_code_Check_rdrand_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_CCons (va_code_Cpuid_Rdrand ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ())))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_rdrand_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_pbool_and (va_codegen_success_Cpuid_Rdrand ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ()))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_rdrand_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_rdrand_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 248 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 250 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 251 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 252 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Rdrand ()) (fun (va_s:va_state) _ -> let (va_arg14:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 253 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg14 30) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 254 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 255 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 256 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 258 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 29)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 259 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 1 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 260 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 29) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 262 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))) [@"opaque_to_smt"] let va_lemma_Check_rdrand_support va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Check_rdrand_support va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Check_rdrand_support ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 240 column 1 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 245 column 36 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRax va_sM =!= 0 ==> rdrand_enabled) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 24 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Check_rdrand_support va_s0 va_k = let (va_sM, va_f0) = va_lemma_Check_rdrand_support (va_code_Check_rdrand_support ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR9; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Check_avx512_support [@ "opaque_to_smt" va_qattr] let va_code_Check_avx512_support () = (va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Cpuid_Avx512 ()) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_CNil ()))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Check_avx512_support () = (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cpuid_Avx512 ()) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (va_pbool_and (va_codegen_success_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_ttrue ())))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Check_avx512_support (va_mods:va_mods_t) : (va_quickCode unit (va_code_Check_avx512_support ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 273 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 275 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 7)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 276 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 277 column 17 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Cpuid_Avx512 ()) (fun (va_s:va_state) _ -> let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 278 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg49 16) (let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 279 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg48 17) (let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 280 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg47 30) (let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 281 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg46 31) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 284 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 285 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 286 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 288 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 65536)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 289 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 131072)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 290 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 1073741824)) (fun (va_s:va_state) _ -> va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 292 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (65536 == Prims.pow2 16)) (fun _ -> (fun (p:prop) -> p) (65536 == Prims.pow2 16)) (fun (_:unit) -> assert_normalize (65536 == Prims.pow2 16)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 293 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (131072 == Prims.pow2 17)) (fun _ -> (fun (p:prop) -> p) (131072 == Prims.pow2 17)) (fun (_:unit) -> assert_normalize (131072 == Prims.pow2 17)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 294 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (1073741824 == Prims.pow2 30)) (fun _ -> (fun (p:prop) -> p) (1073741824 == Prims.pow2 30)) (fun (_:unit) -> assert_normalize (1073741824 == Prims.pow2 30)) (va_QLemma va_range1 "***** PRECONDITION NOT MET AT line 295 column 21 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" ((fun (p:prop) -> normalize p) (2147483648 == Prims.pow2 31)) (fun _ -> (fun (p:prop) -> p) (2147483648 == Prims.pow2 31)) (fun (_:unit) -> assert_normalize (2147483648 == Prims.pow2 31)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 297 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rRax) (va_const_shift_amt64 1)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 17) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 299 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 1) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 301 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR10) (va_const_shift_amt64 14)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 302 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 30) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 303 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 14) (let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 305 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg44 va_arg45 16) (let (va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 23 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_pow2_64 va_arg43 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 307 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 310 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_const_opr64 2147483648)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 311 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRbx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 312 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Shr64 (va_op_dst_opr64_reg64 rR11) (va_const_shift_amt64 15)) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 313 column 27 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_pow2_diff64 16 31) (va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 22 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_ishr_zero64 15) (let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 316 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg41 va_arg42 16) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR10)) (fun (va_s:va_state) _ -> let (va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 318 column 29 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (fun (_:unit) -> Vale.Arch.TypesNative.lemma_iand_maybe_pow2_64 va_arg39 va_arg40 16) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 319 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_And64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 321 column 10 of file /home/gebner/everest/hacl-star/vale/code/lib/util/x64/Vale.Lib.X64.Cpuid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR9)) (va_QEmpty (()))))))))))))))))))))))))))))))))))))))))
false
false
Vale.Lib.X64.Cpuid.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val va_lemma_Check_avx512_support : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Check_avx512_support ()) 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_get_reg64 rRax va_sM =!= 0 ==> avx512_cpuid_enabled) /\ va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0 /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))
[]
Vale.Lib.X64.Cpuid.va_lemma_Check_avx512_support
{ "file_name": "obj/Vale.Lib.X64.Cpuid.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
{ "end_col": 16, "end_line": 981, "start_col": 47, "start_line": 965 }