file_name
stringlengths 5
52
| name
stringlengths 4
95
| original_source_type
stringlengths 0
23k
| source_type
stringlengths 9
23k
| source_definition
stringlengths 9
57.9k
| source
dict | source_range
dict | file_context
stringlengths 0
721k
| dependencies
dict | opens_and_abbrevs
listlengths 2
94
| vconfig
dict | interleaved
bool 1
class | verbose_type
stringlengths 1
7.42k
| effect
stringclasses 118
values | effect_flags
sequencelengths 0
2
| mutual_with
sequencelengths 0
11
| ideal_premises
sequencelengths 0
236
| proof_features
sequencelengths 0
1
| is_simple_lemma
bool 2
classes | is_div
bool 2
classes | is_proof
bool 2
classes | is_simply_typed
bool 2
classes | is_type
bool 2
classes | partial_definition
stringlengths 5
3.99k
| completed_definiton
stringlengths 1
1.63M
| isa_cross_project_example
bool 1
class |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.rewrite_equality | val rewrite_equality (t: term) : Tac unit | val rewrite_equality (t: term) : Tac unit | let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ()) | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 43,
"end_line": 610,
"start_col": 0,
"start_line": 609
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ()) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | t: FStar.Stubs.Reflection.Types.term -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"FStar.Stubs.Reflection.Types.term",
"FStar.Tactics.V1.Derived.try_rewrite_equality",
"Prims.unit",
"FStar.Stubs.Reflection.Types.binders",
"FStar.Tactics.V1.Derived.cur_binders"
] | [] | false | true | false | false | false | let rewrite_equality (t: term) : Tac unit =
| try_rewrite_equality t (cur_binders ()) | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.grewrite | val grewrite (t1 t2: term) : Tac unit | val grewrite (t1 t2: term) : Tac unit | let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ()) | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 44,
"end_line": 655,
"start_col": 0,
"start_line": 640
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2]. | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | t1: FStar.Stubs.Reflection.Types.term -> t2: FStar.Stubs.Reflection.Types.term
-> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"FStar.Stubs.Reflection.Types.term",
"FStar.Tactics.V1.Derived.pointwise",
"Prims.unit",
"FStar.Tactics.V1.Derived.trefl",
"Prims.bool",
"FStar.Tactics.V1.Derived.try_with",
"FStar.Tactics.V1.Derived.exact",
"Prims.exn",
"FStar.Pervasives.Native.option",
"FStar.Stubs.Reflection.Types.typ",
"FStar.Stubs.Reflection.V1.Builtins.inspect_ln",
"Prims.nat",
"FStar.Stubs.Reflection.Types.ctx_uvar_and_subst",
"FStar.Stubs.Reflection.V1.Data.term_view",
"FStar.Reflection.V1.Formula.formula",
"FStar.Reflection.V1.Formula.term_as_formula",
"FStar.Tactics.V1.Derived.cur_goal",
"FStar.Stubs.Reflection.V1.Builtins.pack_ln",
"FStar.Stubs.Reflection.V1.Data.Tv_Var",
"FStar.Reflection.V1.Derived.bv_of_binder",
"FStar.Stubs.Reflection.Types.binder",
"FStar.Tactics.V1.Derived.tcut",
"FStar.Tactics.V1.Derived.mk_sq_eq"
] | [] | false | true | false | false | false | let grewrite (t1 t2: term) : Tac unit =
| let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
let is_uvar =
match term_as_formula (cur_goal ()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar then trefl () else try exact e with | _ -> trefl ()) | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.repeat | val repeat (#a: Type) (t: (unit -> Tac a)) : Tac (list a) | val repeat (#a: Type) (t: (unit -> Tac a)) : Tac (list a) | let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 28,
"end_line": 436,
"start_col": 0,
"start_line": 433
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") () | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | t: (_: Prims.unit -> FStar.Tactics.Effect.Tac a) -> FStar.Tactics.Effect.Tac (Prims.list a) | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.unit",
"Prims.exn",
"Prims.Nil",
"Prims.list",
"Prims.Cons",
"FStar.Tactics.V1.Derived.repeat",
"FStar.Pervasives.either",
"FStar.Stubs.Tactics.V1.Builtins.catch"
] | [
"recursion"
] | false | true | false | false | false | let rec repeat (#a: Type) (t: (unit -> Tac a)) : Tac (list a) =
| match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.mk_sq_eq | val mk_sq_eq (t1 t2: term) : term | val mk_sq_eq (t1 t2: term) : term | let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2]) | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 36,
"end_line": 636,
"start_col": 0,
"start_line": 634
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t] | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | t1: FStar.Stubs.Reflection.Types.term -> t2: FStar.Stubs.Reflection.Types.term
-> FStar.Stubs.Reflection.Types.term | Prims.Tot | [
"total"
] | [] | [
"FStar.Stubs.Reflection.Types.term",
"FStar.Tactics.V1.Derived.mk_squash",
"FStar.Reflection.V1.Derived.mk_e_app",
"Prims.Cons",
"Prims.Nil",
"FStar.Stubs.Reflection.V1.Builtins.pack_ln",
"FStar.Stubs.Reflection.V1.Data.Tv_FVar",
"FStar.Stubs.Reflection.V1.Builtins.pack_fv",
"FStar.Reflection.Const.eq2_qn"
] | [] | false | false | false | true | false | let mk_sq_eq (t1 t2: term) : term =
| let eq:term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2]) | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.grewrite_eq | val grewrite_eq (b: binder) : Tac unit | val grewrite_eq (b: binder) : Tac unit | let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 7,
"end_line": 674,
"start_col": 0,
"start_line": 661
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = () | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | b: FStar.Stubs.Reflection.Types.binder -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"FStar.Stubs.Reflection.Types.binder",
"FStar.Pervasives.Native.option",
"FStar.Stubs.Reflection.Types.typ",
"FStar.Stubs.Reflection.Types.term",
"FStar.Tactics.V1.Derived.iseq",
"Prims.Cons",
"Prims.unit",
"FStar.Tactics.V1.Derived.idtac",
"FStar.Tactics.V1.Derived.exact",
"FStar.Tactics.V1.Derived.binder_to_term",
"Prims.Nil",
"FStar.Tactics.V1.Derived.grewrite",
"FStar.Reflection.V1.Formula.formula",
"FStar.Tactics.V1.Derived.apply_lemma",
"FStar.Tactics.V1.Derived.fail",
"FStar.Reflection.V1.Formula.term_as_formula'",
"FStar.Reflection.V1.Derived.type_of_binder",
"FStar.Reflection.V1.Formula.term_as_formula"
] | [] | false | true | false | false | false | let grewrite_eq (b: binder) : Tac unit =
| match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [
idtac;
(fun () ->
apply_lemma (`__un_sq_eq);
exact (binder_to_term b))
]
| _ -> fail "grewrite_eq: binder type is not an equality" | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.mapply | val mapply (t: term) : Tac unit | val mapply (t: term) : Tac unit | let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 28,
"end_line": 756,
"start_col": 0,
"start_line": 755
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | t: FStar.Stubs.Reflection.Types.term -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"FStar.Stubs.Reflection.Types.term",
"FStar.Tactics.V1.Derived.apply_squash_or_lem",
"Prims.unit"
] | [] | false | true | false | false | false | let mapply (t: term) : Tac unit =
| apply_squash_or_lem 10 t | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.admit_dump | val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a | val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a | let admit_dump #a #x () = x () | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 30,
"end_line": 765,
"start_col": 0,
"start_line": 765
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.unit -> Prims.Admit a | Prims.Admit | [] | [] | [
"Prims.unit"
] | [] | false | true | false | false | false | let admit_dump #a #x () =
| x () | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.magic_dump_t | val magic_dump_t: Prims.unit -> Tac unit | val magic_dump_t: Prims.unit -> Tac unit | let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
() | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 4,
"end_line": 772,
"start_col": 0,
"start_line": 768
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x () | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.unit -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.unit",
"FStar.Tactics.V1.Derived.exact",
"FStar.Tactics.V1.Derived.apply",
"FStar.Stubs.Tactics.V1.Builtins.dump"
] | [] | false | true | false | false | false | let magic_dump_t () : Tac unit =
| dump "Admitting";
apply (`magic);
exact (`());
() | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.add_elem | val add_elem (t: (unit -> Tac 'a)) : Tac 'a | val add_elem (t: (unit -> Tac 'a)) : Tac 'a | let add_elem (t : unit -> Tac 'a) : Tac 'a = focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x
)
) | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 3,
"end_line": 805,
"start_col": 0,
"start_line": 798
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x
let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | t: (_: Prims.unit -> FStar.Tactics.Effect.Tac 'a) -> FStar.Tactics.Effect.Tac 'a | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.unit",
"FStar.Tactics.V1.Derived.focus",
"FStar.Tactics.V1.Derived.qed",
"FStar.Tactics.V1.Derived.apply"
] | [] | false | true | false | false | false | let add_elem (t: (unit -> Tac 'a)) : Tac 'a =
| focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x)) | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.solve_then | val solve_then (#a #b: _) (t1: (unit -> Tac a)) (t2: (a -> Tac b)) : Tac b | val solve_then (#a #b: _) (t1: (unit -> Tac a)) (t2: (a -> Tac b)) : Tac b | let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 5,
"end_line": 796,
"start_col": 0,
"start_line": 791
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | t1: (_: Prims.unit -> FStar.Tactics.Effect.Tac a) -> t2: (_: a -> FStar.Tactics.Effect.Tac b)
-> FStar.Tactics.Effect.Tac b | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.unit",
"FStar.Tactics.V1.Derived.trefl",
"FStar.Tactics.V1.Derived.focus",
"FStar.Tactics.V1.Derived.finish_by",
"FStar.Stubs.Tactics.V1.Builtins.dup"
] | [] | false | true | false | false | false | let solve_then #a #b (t1: (unit -> Tac a)) (t2: (a -> Tac b)) : Tac b =
| dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.change_sq | val change_sq (t1: term) : Tac unit | val change_sq (t1: term) : Tac unit | let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1]) | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 36,
"end_line": 784,
"start_col": 0,
"start_line": 783
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | t1: FStar.Stubs.Reflection.Types.term -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"FStar.Stubs.Reflection.Types.term",
"FStar.Stubs.Tactics.V1.Builtins.change",
"FStar.Reflection.V1.Derived.mk_e_app",
"Prims.Cons",
"Prims.Nil",
"Prims.unit"
] | [] | false | true | false | false | false | let change_sq (t1: term) : Tac unit =
| change (mk_e_app (`squash) [t1]) | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.admit_dump_t | val admit_dump_t: Prims.unit -> Tac unit | val admit_dump_t: Prims.unit -> Tac unit | let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit) | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 16,
"end_line": 762,
"start_col": 0,
"start_line": 760
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.unit -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.unit",
"FStar.Tactics.V1.Derived.apply",
"FStar.Stubs.Tactics.V1.Builtins.dump"
] | [] | false | true | false | false | false | let admit_dump_t () : Tac unit =
| dump "Admitting";
apply (`admit) | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.finish_by | val finish_by (t: (unit -> Tac 'a)) : Tac 'a | val finish_by (t: (unit -> Tac 'a)) : Tac 'a | let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 5,
"end_line": 789,
"start_col": 0,
"start_line": 786
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1]) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | t: (_: Prims.unit -> FStar.Tactics.Effect.Tac 'a) -> FStar.Tactics.Effect.Tac 'a | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.unit",
"FStar.Tactics.V1.Derived.or_else",
"FStar.Tactics.V1.Derived.qed",
"FStar.Tactics.V1.Derived.fail"
] | [] | false | true | false | false | false | let finish_by (t: (unit -> Tac 'a)) : Tac 'a =
| let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.specialize | val specialize: #a: Type -> f: a -> l: list string -> unit -> Tac unit | val specialize: #a: Type -> f: a -> l: list string -> unit -> Tac unit | let specialize (#a:Type) (f:a) (l:list string) :unit -> Tac unit
= fun () -> solve_then (fun () -> exact (quote f)) (fun () -> norm [delta_only l; iota; zeta]) | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 96,
"end_line": 823,
"start_col": 0,
"start_line": 822
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x
let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y
let add_elem (t : unit -> Tac 'a) : Tac 'a = focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x
)
)
(*
* Specialize a function by partially evaluating it
* For example:
* let rec foo (l:list int) (x:int) :St int =
match l with
| [] -> x
| hd::tl -> x + foo tl x
let f :int -> St int = synth_by_tactic (specialize (foo [1; 2]) [%`foo])
* would make the definition of f as x + x + x
*
* f is the term that needs to be specialized
* l is the list of names to be delta-ed | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: a -> l: Prims.list Prims.string -> _: Prims.unit -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.list",
"Prims.string",
"Prims.unit",
"FStar.Tactics.V1.Derived.solve_then",
"FStar.Tactics.V1.Derived.exact",
"FStar.Stubs.Reflection.Types.term",
"FStar.Stubs.Tactics.V1.Builtins.norm",
"Prims.Cons",
"FStar.Pervasives.norm_step",
"FStar.Pervasives.delta_only",
"FStar.Pervasives.iota",
"FStar.Pervasives.zeta",
"Prims.Nil"
] | [] | false | true | false | false | false | let specialize (#a: Type) (f: a) (l: list string) : unit -> Tac unit =
| fun () -> solve_then (fun () -> exact (quote f)) (fun () -> norm [delta_only l; iota; zeta]) | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.magic_dump | val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a | val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a | let magic_dump #a #x () = x | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 27,
"end_line": 775,
"start_col": 0,
"start_line": 775
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
() | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.unit -> a | Prims.Tot | [
"total"
] | [] | [
"Prims.unit"
] | [] | false | false | false | true | false | let magic_dump #a #x () =
| x | false |
Steel.Channel.Simplex.fst | Steel.Channel.Simplex.send_receive_prelude | val send_receive_prelude (#p: prot) (cc: chan p)
: SteelT (chan_val & chan_val)
emp
(fun v ->
(((pts_to cc.chan_chan.send half (fst v)) `star` (pts_to cc.chan_chan.recv half (snd v)))
`star`
(trace_until cc.chan_chan.trace (snd v)))
`star`
(chan_inv_cond (fst v) (snd v))) | val send_receive_prelude (#p: prot) (cc: chan p)
: SteelT (chan_val & chan_val)
emp
(fun v ->
(((pts_to cc.chan_chan.send half (fst v)) `star` (pts_to cc.chan_chan.recv half (snd v)))
`star`
(trace_until cc.chan_chan.trace (snd v)))
`star`
(chan_inv_cond (fst v) (snd v))) | let send_receive_prelude (#p:prot) (cc:chan p)
: SteelT (chan_val & chan_val)
emp
(fun v ->
pts_to cc.chan_chan.send half (fst v) `star`
pts_to cc.chan_chan.recv half (snd v) `star`
trace_until cc.chan_chan.trace (snd v) `star`
chan_inv_cond (fst v) (snd v))
= let c = cc.chan_chan in
Steel.SpinLock.acquire cc.chan_lock;
let vs = read_refine (chan_inv_recv cc.chan_chan) cc.chan_chan.send in
let _ = witness_exists () in
let vr = H.read cc.chan_chan.recv in
rewrite_slprop (trace_until _ _ `star` chan_inv_cond _ _)
(trace_until cc.chan_chan.trace vr `star` chan_inv_cond vs vr)
(fun _ -> ());
return (vs, vr) | {
"file_name": "lib/steel/Steel.Channel.Simplex.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 19,
"end_line": 369,
"start_col": 0,
"start_line": 353
} | (*
Copyright 2020 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 Steel.Channel.Simplex
module P = Steel.Channel.Protocol
open Steel.SpinLock
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.HigherReference
open Steel.FractionalPermission
module MRef = Steel.MonotonicHigherReference
module H = Steel.HigherReference
let sprot = p:prot { more p }
noeq
type chan_val = {
chan_prot : sprot;
chan_msg : msg_t chan_prot;
chan_ctr : nat
}
let mref a p = MRef.ref a p
let trace_ref (p:prot) = mref (partial_trace_of p) extended_to
noeq
type chan_t (p:prot) = {
send: ref chan_val;
recv: ref chan_val;
trace: trace_ref p;
}
let half : perm = half_perm full_perm
let step (s:sprot) (x:msg_t s) = step s x
let chan_inv_step_p (vrecv vsend:chan_val) : prop =
(vsend.chan_prot == step vrecv.chan_prot vrecv.chan_msg /\
vsend.chan_ctr == vrecv.chan_ctr + 1)
let chan_inv_step (vrecv vsend:chan_val) : vprop =
pure (chan_inv_step_p vrecv vsend)
let chan_inv_cond (vsend:chan_val) (vrecv:chan_val) : vprop =
if vsend.chan_ctr = vrecv.chan_ctr
then pure (vsend == vrecv)
else chan_inv_step vrecv vsend
let trace_until_prop #p (r:trace_ref p) (vr:chan_val) (tr: partial_trace_of p) : vprop =
MRef.pts_to r full_perm tr `star`
pure (until tr == step vr.chan_prot vr.chan_msg)
let trace_until #p (r:trace_ref p) (vr:chan_val) =
h_exists (trace_until_prop r vr)
let chan_inv_recv #p (c:chan_t p) (vsend:chan_val) =
h_exists (fun (vrecv:chan_val) ->
pts_to c.recv half vrecv `star`
trace_until c.trace vrecv `star`
chan_inv_cond vsend vrecv)
let chan_inv #p (c:chan_t p) : vprop =
h_exists (fun (vsend:chan_val) ->
pts_to c.send half vsend `star` chan_inv_recv c vsend)
let intro_chan_inv_cond_eqT (vs vr:chan_val)
: Steel unit emp
(fun _ -> chan_inv_cond vs vr)
(requires fun _ -> vs == vr)
(ensures fun _ _ _ -> True)
= intro_pure (vs == vs);
rewrite_slprop (chan_inv_cond vs vs) (chan_inv_cond vs vr) (fun _ -> ())
let intro_chan_inv_cond_stepT (vs vr:chan_val)
: SteelT unit (chan_inv_step vr vs)
(fun _ -> chan_inv_cond vs vr)
= Steel.Utils.extract_pure (chan_inv_step_p vr vs);
rewrite_slprop (chan_inv_step vr vs) (chan_inv_cond vs vr) (fun _ -> ())
let intro_chan_inv_auxT #p (#vs : chan_val)
(#vr : chan_val)
(c:chan_t p)
: SteelT unit (pts_to c.send half vs `star`
pts_to c.recv half vr `star`
trace_until c.trace vr `star`
chan_inv_cond vs vr)
(fun _ -> chan_inv c)
= intro_exists _ (fun (vr:chan_val) -> pts_to c.recv half vr `star` trace_until c.trace vr `star` chan_inv_cond vs vr);
intro_exists _ (fun (vs:chan_val) -> pts_to c.send half vs `star` chan_inv_recv c vs)
let intro_chan_inv_stepT #p (c:chan_t p) (vs vr:chan_val)
: SteelT unit (pts_to c.send half vs `star`
pts_to c.recv half vr `star`
trace_until c.trace vr `star`
chan_inv_step vr vs)
(fun _ -> chan_inv c)
= intro_chan_inv_cond_stepT vs vr;
intro_chan_inv_auxT c
let intro_chan_inv_eqT #p (c:chan_t p) (vs vr:chan_val)
: Steel unit (pts_to c.send half vs `star`
pts_to c.recv half vr `star`
trace_until c.trace vr)
(fun _ -> chan_inv c)
(requires fun _ -> vs == vr)
(ensures fun _ _ _ -> True)
= intro_chan_inv_cond_eqT vs vr;
intro_chan_inv_auxT c
noeq
type chan p = {
chan_chan : chan_t p;
chan_lock : lock (chan_inv chan_chan)
}
let in_state_prop (p:prot) (vsend:chan_val) : prop =
p == step vsend.chan_prot vsend.chan_msg
irreducible
let next_chan_val (#p:sprot) (x:msg_t p) (vs0:chan_val { in_state_prop p vs0 })
: Tot (vs:chan_val{in_state_prop (step p x) vs /\ chan_inv_step_p vs0 vs})
= {
chan_prot = (step vs0.chan_prot vs0.chan_msg);
chan_msg = x;
chan_ctr = vs0.chan_ctr + 1
}
[@@__reduce__]
let in_state_slprop (p:prot) (vsend:chan_val) : vprop = pure (in_state_prop p vsend)
let in_state (r:ref chan_val) (p:prot) =
h_exists (fun (vsend:chan_val) ->
pts_to r half vsend `star` in_state_slprop p vsend)
let sender #q (c:chan q) (p:prot) = in_state c.chan_chan.send p
let receiver #q (c:chan q) (p:prot) = in_state c.chan_chan.recv p
let intro_chan_inv #p (c:chan_t p) (v:chan_val)
: SteelT unit (pts_to c.send half v `star`
pts_to c.recv half v `star`
trace_until c.trace v)
(fun _ -> chan_inv c)
= intro_chan_inv_eqT c v v
let chan_val_p (p:prot) = (vs0:chan_val { in_state_prop p vs0 })
let intro_in_state (r:ref chan_val) (p:prot) (v:chan_val_p p)
: SteelT unit (pts_to r half v) (fun _ -> in_state r p)
= intro_pure (in_state_prop p v);
intro_exists v (fun (v:chan_val) -> pts_to r half v `star` in_state_slprop p v)
let msg t p = Msg Send unit (fun _ -> p)
let init_chan_val (p:prot) = v:chan_val {v.chan_prot == msg unit p}
let initial_trace (p:prot) : (q:partial_trace_of p {until q == p})
= { to = p; tr=Waiting p}
let intro_trace_until #q (r:trace_ref q) (tr:partial_trace_of q) (v:chan_val)
: Steel unit (MRef.pts_to r full_perm tr)
(fun _ -> trace_until r v)
(requires fun _ -> until tr == step v.chan_prot v.chan_msg)
(ensures fun _ _ _ -> True)
= intro_pure (until tr == step v.chan_prot v.chan_msg);
intro_exists tr
(fun (tr:partial_trace_of q) ->
MRef.pts_to r full_perm tr `star`
pure (until tr == (step v.chan_prot v.chan_msg)));
()
let chan_t_sr (p:prot) (send recv:ref chan_val) = (c:chan_t p{c.send == send /\ c.recv == recv})
let intro_trace_until_init #p (c:chan_t p) (v:init_chan_val p)
: SteelT unit (MRef.pts_to c.trace full_perm (initial_trace p))
(fun _ -> trace_until c.trace v)
= intro_pure (until (initial_trace p) == step v.chan_prot v.chan_msg);
//TODO: Not sure why I need this rewrite
rewrite_slprop (MRef.pts_to c.trace full_perm (initial_trace p) `star`
pure (until (initial_trace p) == step v.chan_prot v.chan_msg))
(MRef.pts_to c.trace full_perm (initial_trace p) `star`
pure (until (initial_trace p) == step v.chan_prot v.chan_msg))
(fun _ -> ());
intro_exists (initial_trace p) (trace_until_prop c.trace v)
let mk_chan (#p:prot) (send recv:ref chan_val) (v:init_chan_val p)
: SteelT (chan_t_sr p send recv)
(pts_to send half v `star` pts_to recv half v)
(fun c -> chan_inv c)
= let tr: trace_ref p = MRef.alloc (extended_to #p) (initial_trace p) in
let c = Mkchan_t send recv tr in
rewrite_slprop
(MRef.pts_to tr full_perm (initial_trace p))
(MRef.pts_to c.trace full_perm (initial_trace p)) (fun _ -> ());
intro_trace_until_init c v;
rewrite_slprop
(pts_to send half v `star` pts_to recv half v)
(pts_to c.send half v `star` pts_to c.recv half v)
(fun _ -> ());
intro_chan_inv #p c v;
let c' : chan_t_sr p send recv = c in
rewrite_slprop (chan_inv c) (chan_inv c') (fun _ -> ());
return c'
let new_chan (p:prot) : SteelT (chan p) emp (fun c -> sender c p `star` receiver c p)
= let q = msg unit p in
let v : chan_val = { chan_prot = q; chan_msg = (); chan_ctr = 0 } in
let vp : init_chan_val p = v in
let send = H.alloc v in
let recv = H.alloc v in
H.share recv;
H.share send;
(* TODO: use smt_fallback *)
rewrite_slprop (pts_to send (half_perm full_perm) v `star`
pts_to send (half_perm full_perm) v `star`
pts_to recv (half_perm full_perm) v `star`
pts_to recv (half_perm full_perm) v)
(pts_to send half vp `star`
pts_to send half vp `star`
pts_to recv half vp `star`
pts_to recv half vp)
(fun _ -> ());
let c = mk_chan send recv vp in
intro_in_state send p vp;
intro_in_state recv p vp;
let l = Steel.SpinLock.new_lock (chan_inv c) in
let ch = { chan_chan = c; chan_lock = l } in
rewrite_slprop (in_state send p) (sender ch p) (fun _ -> ());
rewrite_slprop (in_state recv p) (receiver ch p) (fun _ -> ());
return ch
[@@__reduce__]
let send_recv_in_sync (r:ref chan_val) (p:prot{more p}) #q (c:chan_t q) (vs vr:chan_val) : vprop =
(pts_to c.send half vs `star`
pts_to c.recv half vr `star`
trace_until c.trace vr `star`
pure (vs == vr) `star`
in_state r p)
[@@__reduce__]
let sender_ahead (r:ref chan_val) (p:prot{more p}) #q (c:chan_t q) (vs vr:chan_val) : vprop =
(pts_to c.send half vs `star`
pts_to c.recv half vr `star`
trace_until c.trace vr `star`
chan_inv_step vr vs `star`
in_state r p)
let update_channel (#p:sprot) #q (c:chan_t q) (x:msg_t p) (vs:chan_val) (r:ref chan_val)
: SteelT chan_val
(pts_to r full_perm vs `star` in_state_slprop p vs)
(fun vs' -> pts_to r full_perm vs' `star` (in_state_slprop (step p x) vs' `star` chan_inv_step vs vs'))
= elim_pure (in_state_prop p vs);
let vs' = next_chan_val x vs in
H.write r vs';
intro_pure (in_state_prop (step p x) vs');
intro_pure (chan_inv_step_p vs vs');
return vs'
[@@__reduce__]
let send_pre_available (p:sprot) #q (c:chan_t q) (vs vr:chan_val) = send_recv_in_sync c.send p c vs vr
let gather_r (#p:sprot) (r:ref chan_val) (v:chan_val)
: SteelT unit
(pts_to r half v `star` in_state r p)
(fun _ -> pts_to r full_perm v `star` in_state_slprop p v)
= let v' = witness_exists () in
H.higher_ref_pts_to_injective_eq #_ #_ #_ #_ #v #_ r;
H.gather #_ #_ #half #half #v #v r;
rewrite_slprop (pts_to r (sum_perm half half) v) (pts_to r full_perm v) (fun _ -> ());
rewrite_slprop (in_state_slprop p v') (in_state_slprop p v) (fun _ -> ())
let send_available (#p:sprot) #q (cc:chan q) (x:msg_t p) (vs vr:chan_val) (_:unit)
: SteelT unit (send_pre_available p #q cc.chan_chan vs vr) (fun _ -> sender cc (step p x))
= Steel.Utils.extract_pure (vs == vr);
Steel.Utils.rewrite #_ #(send_recv_in_sync cc.chan_chan.send p cc.chan_chan vs) vr vs;
elim_pure (vs == vs);
gather_r cc.chan_chan.send vs;
let next_vs = update_channel cc.chan_chan x vs cc.chan_chan.send in
H.share cc.chan_chan.send;
intro_exists next_vs (fun (next_vs:chan_val) -> pts_to cc.chan_chan.send half next_vs `star` in_state_slprop (step p x) next_vs);
intro_chan_inv_stepT cc.chan_chan next_vs vs;
Steel.SpinLock.release cc.chan_lock
let extensible (#p:prot) (x:partial_trace_of p) = P.more x.to
let next_msg_t (#p:prot) (x:partial_trace_of p) = P.next_msg_t x.to
let next_trace #p (vr:chan_val) (vs:chan_val)
(tr:partial_trace_of p)
(s:squash (until tr == step vr.chan_prot vr.chan_msg))
(_:squash (chan_inv_step_p vr vs))
: (ts:partial_trace_of p { until ts == step vs.chan_prot vs.chan_msg })
= let msg : next_msg_t tr = vs.chan_msg in
assert (extensible tr);
extend_partial_trace tr msg
let next_trace_st #p (vr:chan_val) (vs:chan_val) (tr:partial_trace_of p)
: Steel (extension_of tr)
(chan_inv_step vr vs)
(fun _ -> emp)
(requires fun _ -> until tr == step vr.chan_prot vr.chan_msg)
(ensures fun _ ts _ -> until ts == step vs.chan_prot vs.chan_msg)
= elim_pure (chan_inv_step_p vr vs);
let ts : extension_of tr = next_trace vr vs tr () () in
return ts
let update_trace #p (r:trace_ref p) (vr:chan_val) (vs:chan_val)
: Steel unit
(trace_until r vr)
(fun _ -> trace_until r vs)
(requires fun _ -> chan_inv_step_p vr vs)
(ensures fun _ _ _ -> True)
= intro_pure (chan_inv_step_p vr vs);
let tr = MRef.read_refine r in
elim_pure (until tr == step vr.chan_prot vr.chan_msg);
let ts : extension_of tr = next_trace_st vr vs tr in
MRef.write r ts;
intro_pure (until ts == step vs.chan_prot vs.chan_msg);
intro_exists ts
(fun (ts:partial_trace_of p) ->
MRef.pts_to r full_perm ts `star`
pure (until ts == step vs.chan_prot vs.chan_msg))
let recv_availableT (#p:sprot) #q (cc:chan q) (vs vr:chan_val) (_:unit)
: SteelT (msg_t p)
(sender_ahead cc.chan_chan.recv p cc.chan_chan vs vr)
(fun x -> receiver cc (step p x))
= elim_pure (chan_inv_step_p vr vs);
gather_r cc.chan_chan.recv vr;
elim_pure (in_state_prop p vr);
H.write cc.chan_chan.recv vs;
H.share cc.chan_chan.recv;
assert (vs.chan_prot == p);
let vs_msg : msg_t p = vs.chan_msg in
intro_pure (in_state_prop (step p vs_msg) vs);
intro_exists vs (fun (vs:chan_val) -> pts_to cc.chan_chan.recv half vs `star` in_state_slprop (step p vs_msg) vs);
update_trace cc.chan_chan.trace vr vs;
intro_chan_inv cc.chan_chan vs;
Steel.SpinLock.release cc.chan_lock;
vs_msg | {
"checked_file": "/",
"dependencies": [
"Steel.Utils.fst.checked",
"Steel.SpinLock.fsti.checked",
"Steel.MonotonicHigherReference.fsti.checked",
"Steel.Memory.fsti.checked",
"Steel.HigherReference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"Steel.Channel.Protocol.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Channel.Simplex.fst"
} | [
{
"abbrev": true,
"full_module": "Steel.HigherReference",
"short_module": "H"
},
{
"abbrev": true,
"full_module": "Steel.MonotonicHigherReference",
"short_module": "MRef"
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.HigherReference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.SpinLock",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Channel.Protocol",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Channel.Protocol",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Channel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Channel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | cc: Steel.Channel.Simplex.chan p
-> Steel.Effect.SteelT (Steel.Channel.Simplex.chan_val * Steel.Channel.Simplex.chan_val) | Steel.Effect.SteelT | [] | [] | [
"Steel.Channel.Simplex.prot",
"Steel.Channel.Simplex.chan",
"Steel.Effect.Atomic.return",
"FStar.Pervasives.Native.tuple2",
"Steel.Channel.Simplex.chan_val",
"FStar.Ghost.hide",
"FStar.Set.set",
"Steel.Memory.iname",
"FStar.Set.empty",
"Steel.Effect.Common.VStar",
"Steel.HigherReference.pts_to",
"Steel.Channel.Simplex.__proj__Mkchan_t__item__send",
"Steel.Channel.Simplex.__proj__Mkchan__item__chan_chan",
"Steel.Channel.Simplex.half",
"Steel.Channel.Simplex.__proj__Mkchan_t__item__recv",
"Steel.Channel.Simplex.trace_until",
"Steel.Channel.Simplex.__proj__Mkchan_t__item__trace",
"Steel.Channel.Simplex.chan_inv_cond",
"Steel.Effect.Common.vprop",
"FStar.Pervasives.Native.Mktuple2",
"Prims.unit",
"Steel.Effect.Atomic.rewrite_slprop",
"Steel.Effect.Common.star",
"FStar.Ghost.reveal",
"Steel.Memory.mem",
"Steel.HigherReference.read",
"FStar.Ghost.erased",
"Steel.Effect.Atomic.witness_exists",
"Steel.HigherReference.read_refine",
"Steel.Channel.Simplex.chan_inv_recv",
"Steel.SpinLock.acquire",
"Steel.Channel.Simplex.chan_inv",
"Steel.Channel.Simplex.__proj__Mkchan__item__chan_lock",
"Steel.Channel.Simplex.chan_t",
"Steel.Effect.Common.emp",
"FStar.Pervasives.Native.fst",
"FStar.Pervasives.Native.snd"
] | [] | false | true | false | false | false | let send_receive_prelude (#p: prot) (cc: chan p)
: SteelT (chan_val & chan_val)
emp
(fun v ->
(((pts_to cc.chan_chan.send half (fst v)) `star` (pts_to cc.chan_chan.recv half (snd v)))
`star`
(trace_until cc.chan_chan.trace (snd v)))
`star`
(chan_inv_cond (fst v) (snd v))) =
| let c = cc.chan_chan in
Steel.SpinLock.acquire cc.chan_lock;
let vs = read_refine (chan_inv_recv cc.chan_chan) cc.chan_chan.send in
let _ = witness_exists () in
let vr = H.read cc.chan_chan.recv in
rewrite_slprop ((trace_until _ _) `star` (chan_inv_cond _ _))
((trace_until cc.chan_chan.trace vr) `star` (chan_inv_cond vs vr))
(fun _ -> ());
return (vs, vr) | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.name_appears_in | val name_appears_in (nm: name) (t: term) : Tac bool | val name_appears_in (nm: name) (t: term) : Tac bool | let name_appears_in (nm:name) (t:term) : Tac bool =
let ff (t : term) : Tac term =
match inspect_ln t with
| Tv_FVar fv ->
if inspect_fv fv = nm then
raise Appears;
t
| _ -> t
in
try ignore (V.visit_tm ff t); false with
| Appears -> true
| e -> raise e | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 16,
"end_line": 929,
"start_col": 0,
"start_line": 918
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x
let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y
let add_elem (t : unit -> Tac 'a) : Tac 'a = focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x
)
)
(*
* Specialize a function by partially evaluating it
* For example:
* let rec foo (l:list int) (x:int) :St int =
match l with
| [] -> x
| hd::tl -> x + foo tl x
let f :int -> St int = synth_by_tactic (specialize (foo [1; 2]) [%`foo])
* would make the definition of f as x + x + x
*
* f is the term that needs to be specialized
* l is the list of names to be delta-ed
*)
let specialize (#a:Type) (f:a) (l:list string) :unit -> Tac unit
= fun () -> solve_then (fun () -> exact (quote f)) (fun () -> norm [delta_only l; iota; zeta])
let tlabel (l:string) =
match goals () with
| [] -> fail "tlabel: no goals"
| h::t ->
set_goals (set_label l h :: t)
let tlabel' (l:string) =
match goals () with
| [] -> fail "tlabel': no goals"
| h::t ->
let h = set_label (l ^ get_label h) h in
set_goals (h :: t)
let focus_all () : Tac unit =
set_goals (goals () @ smt_goals ());
set_smt_goals []
private
let rec extract_nth (n:nat) (l : list 'a) : option ('a * list 'a) =
match n, l with
| _, [] -> None
| 0, hd::tl -> Some (hd, tl)
| _, hd::tl -> begin
match extract_nth (n-1) tl with
| Some (hd', tl') -> Some (hd', hd::tl')
| None -> None
end
let bump_nth (n:pos) : Tac unit =
// n-1 since goal numbering begins at 1
match extract_nth (n - 1) (goals ()) with
| None -> fail "bump_nth: not that many goals"
| Some (h, t) -> set_goals (h :: t)
let rec destruct_list (t : term) : Tac (list term) =
let head, args = collect_app t in
match inspect_ln head, args with
| Tv_FVar fv, [(a1, Q_Explicit); (a2, Q_Explicit)]
| Tv_FVar fv, [(_, Q_Implicit); (a1, Q_Explicit); (a2, Q_Explicit)] ->
if inspect_fv fv = cons_qn
then a1 :: destruct_list a2
else raise NotAListLiteral
| Tv_FVar fv, _ ->
if inspect_fv fv = nil_qn
then []
else raise NotAListLiteral
| _ ->
raise NotAListLiteral
private let get_match_body () : Tac term =
match unsquash_term (cur_goal ()) with
| None -> fail ""
| Some t -> match inspect_unascribe t with
| Tv_Match sc _ _ -> sc
| _ -> fail "Goal is not a match"
private let rec last (x : list 'a) : Tac 'a =
match x with
| [] -> fail "last: empty list"
| [x] -> x
| _::xs -> last xs
(** When the goal is [match e with | p1 -> e1 ... | pn -> en],
destruct it into [n] goals for each possible case, including an
hypothesis for [e] matching the corresponding pattern. *)
let branch_on_match () : Tac unit =
focus (fun () ->
let x = get_match_body () in
let _ = t_destruct x in
iterAll (fun () ->
let bs = repeat intro in
let b = last bs in (* this one is the equality *)
grewrite_eq b;
norm [iota])
)
(** When the argument [i] is non-negative, [nth_binder] grabs the nth
binder in the current goal. When it is negative, it grabs the (-i-1)th
binder counting from the end of the goal. That is, [nth_binder (-1)]
will return the last binder, [nth_binder (-2)] the second to last, and
so on. *)
let nth_binder (i:int) : Tac binder =
let bs = cur_binders () in
let k : int = if i >= 0 then i else List.Tot.Base.length bs + i in
let k : nat = if k < 0 then fail "not enough binders" else k in
match List.Tot.Base.nth bs k with
| None -> fail "not enough binders"
| Some b -> b
exception Appears
(** Decides whether a top-level name [nm] syntactically | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | nm: FStar.Stubs.Reflection.Types.name -> t: FStar.Stubs.Reflection.Types.term
-> FStar.Tactics.Effect.Tac Prims.bool | FStar.Tactics.Effect.Tac | [] | [] | [
"FStar.Stubs.Reflection.Types.name",
"FStar.Stubs.Reflection.Types.term",
"FStar.Tactics.V1.Derived.try_with",
"Prims.bool",
"Prims.unit",
"FStar.Pervasives.ignore",
"FStar.Tactics.Visit.visit_tm",
"Prims.exn",
"FStar.Tactics.Effect.raise",
"FStar.Stubs.Reflection.V1.Builtins.inspect_ln",
"FStar.Stubs.Reflection.Types.fv",
"Prims.op_Equality",
"FStar.Stubs.Reflection.V1.Builtins.inspect_fv",
"FStar.Tactics.V1.Derived.Appears",
"FStar.Stubs.Reflection.V1.Data.term_view"
] | [] | false | true | false | false | false | let name_appears_in (nm: name) (t: term) : Tac bool =
| let ff (t: term) : Tac term =
match inspect_ln t with
| Tv_FVar fv ->
if inspect_fv fv = nm then raise Appears;
t
| _ -> t
in
try
(ignore (V.visit_tm ff t);
false)
with
| Appears -> true
| e -> raise e | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.focus_all | val focus_all: Prims.unit -> Tac unit | val focus_all: Prims.unit -> Tac unit | let focus_all () : Tac unit =
set_goals (goals () @ smt_goals ());
set_smt_goals [] | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 20,
"end_line": 840,
"start_col": 0,
"start_line": 838
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x
let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y
let add_elem (t : unit -> Tac 'a) : Tac 'a = focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x
)
)
(*
* Specialize a function by partially evaluating it
* For example:
* let rec foo (l:list int) (x:int) :St int =
match l with
| [] -> x
| hd::tl -> x + foo tl x
let f :int -> St int = synth_by_tactic (specialize (foo [1; 2]) [%`foo])
* would make the definition of f as x + x + x
*
* f is the term that needs to be specialized
* l is the list of names to be delta-ed
*)
let specialize (#a:Type) (f:a) (l:list string) :unit -> Tac unit
= fun () -> solve_then (fun () -> exact (quote f)) (fun () -> norm [delta_only l; iota; zeta])
let tlabel (l:string) =
match goals () with
| [] -> fail "tlabel: no goals"
| h::t ->
set_goals (set_label l h :: t)
let tlabel' (l:string) =
match goals () with
| [] -> fail "tlabel': no goals"
| h::t ->
let h = set_label (l ^ get_label h) h in
set_goals (h :: t) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.unit -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.unit",
"FStar.Stubs.Tactics.V1.Builtins.set_smt_goals",
"Prims.Nil",
"FStar.Stubs.Tactics.Types.goal",
"FStar.Stubs.Tactics.V1.Builtins.set_goals",
"Prims.list",
"FStar.Tactics.V1.Derived.op_At",
"FStar.Tactics.V1.Derived.smt_goals",
"FStar.Tactics.V1.Derived.goals"
] | [] | false | true | false | false | false | let focus_all () : Tac unit =
| set_goals (goals () @ smt_goals ());
set_smt_goals [] | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.branch_on_match | val branch_on_match: Prims.unit -> Tac unit | val branch_on_match: Prims.unit -> Tac unit | let branch_on_match () : Tac unit =
focus (fun () ->
let x = get_match_body () in
let _ = t_destruct x in
iterAll (fun () ->
let bs = repeat intro in
let b = last bs in (* this one is the equality *)
grewrite_eq b;
norm [iota])
) | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 5,
"end_line": 899,
"start_col": 0,
"start_line": 890
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x
let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y
let add_elem (t : unit -> Tac 'a) : Tac 'a = focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x
)
)
(*
* Specialize a function by partially evaluating it
* For example:
* let rec foo (l:list int) (x:int) :St int =
match l with
| [] -> x
| hd::tl -> x + foo tl x
let f :int -> St int = synth_by_tactic (specialize (foo [1; 2]) [%`foo])
* would make the definition of f as x + x + x
*
* f is the term that needs to be specialized
* l is the list of names to be delta-ed
*)
let specialize (#a:Type) (f:a) (l:list string) :unit -> Tac unit
= fun () -> solve_then (fun () -> exact (quote f)) (fun () -> norm [delta_only l; iota; zeta])
let tlabel (l:string) =
match goals () with
| [] -> fail "tlabel: no goals"
| h::t ->
set_goals (set_label l h :: t)
let tlabel' (l:string) =
match goals () with
| [] -> fail "tlabel': no goals"
| h::t ->
let h = set_label (l ^ get_label h) h in
set_goals (h :: t)
let focus_all () : Tac unit =
set_goals (goals () @ smt_goals ());
set_smt_goals []
private
let rec extract_nth (n:nat) (l : list 'a) : option ('a * list 'a) =
match n, l with
| _, [] -> None
| 0, hd::tl -> Some (hd, tl)
| _, hd::tl -> begin
match extract_nth (n-1) tl with
| Some (hd', tl') -> Some (hd', hd::tl')
| None -> None
end
let bump_nth (n:pos) : Tac unit =
// n-1 since goal numbering begins at 1
match extract_nth (n - 1) (goals ()) with
| None -> fail "bump_nth: not that many goals"
| Some (h, t) -> set_goals (h :: t)
let rec destruct_list (t : term) : Tac (list term) =
let head, args = collect_app t in
match inspect_ln head, args with
| Tv_FVar fv, [(a1, Q_Explicit); (a2, Q_Explicit)]
| Tv_FVar fv, [(_, Q_Implicit); (a1, Q_Explicit); (a2, Q_Explicit)] ->
if inspect_fv fv = cons_qn
then a1 :: destruct_list a2
else raise NotAListLiteral
| Tv_FVar fv, _ ->
if inspect_fv fv = nil_qn
then []
else raise NotAListLiteral
| _ ->
raise NotAListLiteral
private let get_match_body () : Tac term =
match unsquash_term (cur_goal ()) with
| None -> fail ""
| Some t -> match inspect_unascribe t with
| Tv_Match sc _ _ -> sc
| _ -> fail "Goal is not a match"
private let rec last (x : list 'a) : Tac 'a =
match x with
| [] -> fail "last: empty list"
| [x] -> x
| _::xs -> last xs
(** When the goal is [match e with | p1 -> e1 ... | pn -> en],
destruct it into [n] goals for each possible case, including an | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.unit -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.unit",
"FStar.Tactics.V1.Derived.focus",
"FStar.Tactics.V1.Derived.iterAll",
"FStar.Stubs.Tactics.V1.Builtins.norm",
"Prims.Cons",
"FStar.Pervasives.norm_step",
"FStar.Pervasives.iota",
"Prims.Nil",
"FStar.Tactics.V1.Derived.grewrite_eq",
"FStar.Stubs.Reflection.Types.binder",
"FStar.Tactics.V1.Derived.last",
"Prims.list",
"FStar.Tactics.V1.Derived.repeat",
"FStar.Stubs.Tactics.V1.Builtins.intro",
"FStar.Pervasives.Native.tuple2",
"FStar.Stubs.Reflection.Types.fv",
"Prims.nat",
"FStar.Stubs.Tactics.V1.Builtins.t_destruct",
"FStar.Stubs.Reflection.Types.term",
"FStar.Tactics.V1.Derived.get_match_body"
] | [] | false | true | false | false | false | let branch_on_match () : Tac unit =
| focus (fun () ->
let x = get_match_body () in
let _ = t_destruct x in
iterAll (fun () ->
let bs = repeat intro in
let b = last bs in
grewrite_eq b;
norm [iota])) | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.__eq_sym | val __eq_sym (#t: _) (a b: t) : Lemma ((a == b) == (b == a)) | val __eq_sym (#t: _) (a b: t) : Lemma ((a == b) == (b == a)) | let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a) | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 55,
"end_line": 574,
"start_col": 0,
"start_line": 573
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: t -> b: t -> FStar.Pervasives.Lemma (ensures a == b == (b == a)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"FStar.PropositionalExtensionality.apply",
"Prims.eq2",
"Prims.unit",
"Prims.l_True",
"Prims.squash",
"Prims.logical",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | true | false | true | false | false | let __eq_sym #t (a: t) (b: t) : Lemma ((a == b) == (b == a)) =
| FStar.PropositionalExtensionality.apply (a == b) (b == a) | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.string_to_term_with_lb | val string_to_term_with_lb (letbindings: list (string * term)) (e: env) (t: string) : Tac term | val string_to_term_with_lb (letbindings: list (string * term)) (e: env) (t: string) : Tac term | let string_to_term_with_lb
(letbindings: list (string * term))
(e: env) (t: string): Tac term
= let unk = pack_ln Tv_Unknown in
let e, lb_bvs = fold_left (fun (e, lb_bvs) (i, v) ->
let e, bv = push_bv_dsenv e i in
e, (v,bv)::lb_bvs
) (e, []) letbindings in
let t = string_to_term e t in
fold_left (fun t (i, bv) -> pack (Tv_Let false [] bv unk i t)) t lb_bvs | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 75,
"end_line": 951,
"start_col": 0,
"start_line": 942
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x
let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y
let add_elem (t : unit -> Tac 'a) : Tac 'a = focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x
)
)
(*
* Specialize a function by partially evaluating it
* For example:
* let rec foo (l:list int) (x:int) :St int =
match l with
| [] -> x
| hd::tl -> x + foo tl x
let f :int -> St int = synth_by_tactic (specialize (foo [1; 2]) [%`foo])
* would make the definition of f as x + x + x
*
* f is the term that needs to be specialized
* l is the list of names to be delta-ed
*)
let specialize (#a:Type) (f:a) (l:list string) :unit -> Tac unit
= fun () -> solve_then (fun () -> exact (quote f)) (fun () -> norm [delta_only l; iota; zeta])
let tlabel (l:string) =
match goals () with
| [] -> fail "tlabel: no goals"
| h::t ->
set_goals (set_label l h :: t)
let tlabel' (l:string) =
match goals () with
| [] -> fail "tlabel': no goals"
| h::t ->
let h = set_label (l ^ get_label h) h in
set_goals (h :: t)
let focus_all () : Tac unit =
set_goals (goals () @ smt_goals ());
set_smt_goals []
private
let rec extract_nth (n:nat) (l : list 'a) : option ('a * list 'a) =
match n, l with
| _, [] -> None
| 0, hd::tl -> Some (hd, tl)
| _, hd::tl -> begin
match extract_nth (n-1) tl with
| Some (hd', tl') -> Some (hd', hd::tl')
| None -> None
end
let bump_nth (n:pos) : Tac unit =
// n-1 since goal numbering begins at 1
match extract_nth (n - 1) (goals ()) with
| None -> fail "bump_nth: not that many goals"
| Some (h, t) -> set_goals (h :: t)
let rec destruct_list (t : term) : Tac (list term) =
let head, args = collect_app t in
match inspect_ln head, args with
| Tv_FVar fv, [(a1, Q_Explicit); (a2, Q_Explicit)]
| Tv_FVar fv, [(_, Q_Implicit); (a1, Q_Explicit); (a2, Q_Explicit)] ->
if inspect_fv fv = cons_qn
then a1 :: destruct_list a2
else raise NotAListLiteral
| Tv_FVar fv, _ ->
if inspect_fv fv = nil_qn
then []
else raise NotAListLiteral
| _ ->
raise NotAListLiteral
private let get_match_body () : Tac term =
match unsquash_term (cur_goal ()) with
| None -> fail ""
| Some t -> match inspect_unascribe t with
| Tv_Match sc _ _ -> sc
| _ -> fail "Goal is not a match"
private let rec last (x : list 'a) : Tac 'a =
match x with
| [] -> fail "last: empty list"
| [x] -> x
| _::xs -> last xs
(** When the goal is [match e with | p1 -> e1 ... | pn -> en],
destruct it into [n] goals for each possible case, including an
hypothesis for [e] matching the corresponding pattern. *)
let branch_on_match () : Tac unit =
focus (fun () ->
let x = get_match_body () in
let _ = t_destruct x in
iterAll (fun () ->
let bs = repeat intro in
let b = last bs in (* this one is the equality *)
grewrite_eq b;
norm [iota])
)
(** When the argument [i] is non-negative, [nth_binder] grabs the nth
binder in the current goal. When it is negative, it grabs the (-i-1)th
binder counting from the end of the goal. That is, [nth_binder (-1)]
will return the last binder, [nth_binder (-2)] the second to last, and
so on. *)
let nth_binder (i:int) : Tac binder =
let bs = cur_binders () in
let k : int = if i >= 0 then i else List.Tot.Base.length bs + i in
let k : nat = if k < 0 then fail "not enough binders" else k in
match List.Tot.Base.nth bs k with
| None -> fail "not enough binders"
| Some b -> b
exception Appears
(** Decides whether a top-level name [nm] syntactically
appears in the term [t]. *)
let name_appears_in (nm:name) (t:term) : Tac bool =
let ff (t : term) : Tac term =
match inspect_ln t with
| Tv_FVar fv ->
if inspect_fv fv = nm then
raise Appears;
t
| _ -> t
in
try ignore (V.visit_tm ff t); false with
| Appears -> true
| e -> raise e
(** [mk_abs [x1; ...; xn] t] returns the term [fun x1 ... xn -> t] *)
let rec mk_abs (args : list binder) (t : term) : Tac term (decreases args) =
match args with
| [] -> t
| a :: args' ->
let t' = mk_abs args' t in
pack (Tv_Abs a t')
(** [string_to_term_with_lb [(id1, t1); ...; (idn, tn)] e s] parses
[s] as a term in environment [e] augmented with bindings | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
letbindings: Prims.list (Prims.string * FStar.Stubs.Reflection.Types.term) ->
e: FStar.Stubs.Reflection.Types.env ->
t: Prims.string
-> FStar.Tactics.Effect.Tac FStar.Stubs.Reflection.Types.term | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.list",
"FStar.Pervasives.Native.tuple2",
"Prims.string",
"FStar.Stubs.Reflection.Types.term",
"FStar.Stubs.Reflection.Types.env",
"FStar.Stubs.Reflection.Types.bv",
"FStar.Tactics.Util.fold_left",
"FStar.Stubs.Tactics.V1.Builtins.pack",
"FStar.Stubs.Reflection.V1.Data.Tv_Let",
"Prims.Nil",
"FStar.Stubs.Tactics.V1.Builtins.string_to_term",
"FStar.Pervasives.Native.Mktuple2",
"Prims.Cons",
"FStar.Stubs.Tactics.V1.Builtins.push_bv_dsenv",
"FStar.Stubs.Reflection.V1.Builtins.pack_ln",
"FStar.Stubs.Reflection.V1.Data.Tv_Unknown"
] | [] | false | true | false | false | false | let string_to_term_with_lb (letbindings: list (string * term)) (e: env) (t: string) : Tac term =
| let unk = pack_ln Tv_Unknown in
let e, lb_bvs =
fold_left (fun (e, lb_bvs) (i, v) ->
let e, bv = push_bv_dsenv e i in
e, (v, bv) :: lb_bvs)
(e, [])
letbindings
in
let t = string_to_term e t in
fold_left (fun t (i, bv) -> pack (Tv_Let false [] bv unk i t)) t lb_bvs | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.rewrite_all_context_equalities | val rewrite_all_context_equalities (bs: binders) : Tac unit | val rewrite_all_context_equalities (bs: binders) : Tac unit | let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 7,
"end_line": 604,
"start_col": 0,
"start_line": 598
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | bs: FStar.Stubs.Reflection.Types.binders -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"FStar.Stubs.Reflection.Types.binders",
"Prims.unit",
"FStar.Stubs.Reflection.Types.binder",
"Prims.list",
"FStar.Tactics.V1.Derived.rewrite_all_context_equalities",
"FStar.Tactics.V1.Derived.try_with",
"FStar.Stubs.Tactics.V1.Builtins.rewrite",
"Prims.exn"
] | [
"recursion"
] | false | true | false | false | false | let rec rewrite_all_context_equalities (bs: binders) : Tac unit =
| match bs with
| [] -> ()
| x_t :: bs ->
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.revert_all | val revert_all (bs: binders) : Tac unit | val revert_all (bs: binders) : Tac unit | let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 28,
"end_line": 533,
"start_col": 0,
"start_line": 529
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ()) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | bs: FStar.Stubs.Reflection.Types.binders -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"FStar.Stubs.Reflection.Types.binders",
"Prims.unit",
"FStar.Stubs.Reflection.Types.binder",
"Prims.list",
"FStar.Tactics.V1.Derived.revert_all",
"FStar.Stubs.Tactics.V1.Builtins.revert"
] | [
"recursion"
] | false | true | false | false | false | let rec revert_all (bs: binders) : Tac unit =
| match bs with
| [] -> ()
| _ :: tl ->
revert ();
revert_all tl | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.trans | val trans: Prims.unit -> Tac unit | val trans: Prims.unit -> Tac unit | let trans () : Tac unit = apply_lemma (`lem_trans) | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 50,
"end_line": 960,
"start_col": 0,
"start_line": 960
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x
let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y
let add_elem (t : unit -> Tac 'a) : Tac 'a = focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x
)
)
(*
* Specialize a function by partially evaluating it
* For example:
* let rec foo (l:list int) (x:int) :St int =
match l with
| [] -> x
| hd::tl -> x + foo tl x
let f :int -> St int = synth_by_tactic (specialize (foo [1; 2]) [%`foo])
* would make the definition of f as x + x + x
*
* f is the term that needs to be specialized
* l is the list of names to be delta-ed
*)
let specialize (#a:Type) (f:a) (l:list string) :unit -> Tac unit
= fun () -> solve_then (fun () -> exact (quote f)) (fun () -> norm [delta_only l; iota; zeta])
let tlabel (l:string) =
match goals () with
| [] -> fail "tlabel: no goals"
| h::t ->
set_goals (set_label l h :: t)
let tlabel' (l:string) =
match goals () with
| [] -> fail "tlabel': no goals"
| h::t ->
let h = set_label (l ^ get_label h) h in
set_goals (h :: t)
let focus_all () : Tac unit =
set_goals (goals () @ smt_goals ());
set_smt_goals []
private
let rec extract_nth (n:nat) (l : list 'a) : option ('a * list 'a) =
match n, l with
| _, [] -> None
| 0, hd::tl -> Some (hd, tl)
| _, hd::tl -> begin
match extract_nth (n-1) tl with
| Some (hd', tl') -> Some (hd', hd::tl')
| None -> None
end
let bump_nth (n:pos) : Tac unit =
// n-1 since goal numbering begins at 1
match extract_nth (n - 1) (goals ()) with
| None -> fail "bump_nth: not that many goals"
| Some (h, t) -> set_goals (h :: t)
let rec destruct_list (t : term) : Tac (list term) =
let head, args = collect_app t in
match inspect_ln head, args with
| Tv_FVar fv, [(a1, Q_Explicit); (a2, Q_Explicit)]
| Tv_FVar fv, [(_, Q_Implicit); (a1, Q_Explicit); (a2, Q_Explicit)] ->
if inspect_fv fv = cons_qn
then a1 :: destruct_list a2
else raise NotAListLiteral
| Tv_FVar fv, _ ->
if inspect_fv fv = nil_qn
then []
else raise NotAListLiteral
| _ ->
raise NotAListLiteral
private let get_match_body () : Tac term =
match unsquash_term (cur_goal ()) with
| None -> fail ""
| Some t -> match inspect_unascribe t with
| Tv_Match sc _ _ -> sc
| _ -> fail "Goal is not a match"
private let rec last (x : list 'a) : Tac 'a =
match x with
| [] -> fail "last: empty list"
| [x] -> x
| _::xs -> last xs
(** When the goal is [match e with | p1 -> e1 ... | pn -> en],
destruct it into [n] goals for each possible case, including an
hypothesis for [e] matching the corresponding pattern. *)
let branch_on_match () : Tac unit =
focus (fun () ->
let x = get_match_body () in
let _ = t_destruct x in
iterAll (fun () ->
let bs = repeat intro in
let b = last bs in (* this one is the equality *)
grewrite_eq b;
norm [iota])
)
(** When the argument [i] is non-negative, [nth_binder] grabs the nth
binder in the current goal. When it is negative, it grabs the (-i-1)th
binder counting from the end of the goal. That is, [nth_binder (-1)]
will return the last binder, [nth_binder (-2)] the second to last, and
so on. *)
let nth_binder (i:int) : Tac binder =
let bs = cur_binders () in
let k : int = if i >= 0 then i else List.Tot.Base.length bs + i in
let k : nat = if k < 0 then fail "not enough binders" else k in
match List.Tot.Base.nth bs k with
| None -> fail "not enough binders"
| Some b -> b
exception Appears
(** Decides whether a top-level name [nm] syntactically
appears in the term [t]. *)
let name_appears_in (nm:name) (t:term) : Tac bool =
let ff (t : term) : Tac term =
match inspect_ln t with
| Tv_FVar fv ->
if inspect_fv fv = nm then
raise Appears;
t
| _ -> t
in
try ignore (V.visit_tm ff t); false with
| Appears -> true
| e -> raise e
(** [mk_abs [x1; ...; xn] t] returns the term [fun x1 ... xn -> t] *)
let rec mk_abs (args : list binder) (t : term) : Tac term (decreases args) =
match args with
| [] -> t
| a :: args' ->
let t' = mk_abs args' t in
pack (Tv_Abs a t')
(** [string_to_term_with_lb [(id1, t1); ...; (idn, tn)] e s] parses
[s] as a term in environment [e] augmented with bindings
[id1, t1], ..., [idn, tn]. *)
let string_to_term_with_lb
(letbindings: list (string * term))
(e: env) (t: string): Tac term
= let unk = pack_ln Tv_Unknown in
let e, lb_bvs = fold_left (fun (e, lb_bvs) (i, v) ->
let e, bv = push_bv_dsenv e i in
e, (v,bv)::lb_bvs
) (e, []) letbindings in
let t = string_to_term e t in
fold_left (fun t (i, bv) -> pack (Tv_Let false [] bv unk i t)) t lb_bvs
private
val lem_trans : (#a:Type) -> (#x:a) -> (#z:a) -> (#y:a) ->
squash (x == y) -> squash (y == z) -> Lemma (x == z)
private
let lem_trans #a #x #z #y e1 e2 = () | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.unit -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.unit",
"FStar.Tactics.V1.Derived.apply_lemma"
] | [] | false | true | false | false | false | let trans () : Tac unit =
| apply_lemma (`lem_trans) | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.__assumption_aux | val __assumption_aux (bs: binders) : Tac unit | val __assumption_aux (bs: binders) : Tac unit | let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 27,
"end_line": 557,
"start_col": 0,
"start_line": 548
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | bs: FStar.Stubs.Reflection.Types.binders -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"FStar.Stubs.Reflection.Types.binders",
"FStar.Tactics.V1.Derived.fail",
"Prims.unit",
"FStar.Stubs.Reflection.Types.binder",
"Prims.list",
"FStar.Tactics.V1.Derived.try_with",
"FStar.Tactics.V1.Derived.exact",
"Prims.exn",
"FStar.Tactics.V1.Derived.apply",
"FStar.Tactics.V1.Derived.__assumption_aux",
"FStar.Stubs.Reflection.Types.term",
"FStar.Tactics.V1.Derived.binder_to_term"
] | [
"recursion"
] | false | true | false | false | false | let rec __assumption_aux (bs: binders) : Tac unit =
| match bs with
| [] -> fail "no assumption matches goal"
| b :: bs ->
let t = binder_to_term b in
try exact t
with
| _ ->
try
(apply (`FStar.Squash.return_squash);
exact t)
with
| _ -> __assumption_aux bs | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.try_rewrite_equality | val try_rewrite_equality (x: term) (bs: binders) : Tac unit | val try_rewrite_equality (x: term) (bs: binders) : Tac unit | let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 11,
"end_line": 596,
"start_col": 0,
"start_line": 585
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
() | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: FStar.Stubs.Reflection.Types.term -> bs: FStar.Stubs.Reflection.Types.binders
-> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"FStar.Stubs.Reflection.Types.term",
"FStar.Stubs.Reflection.Types.binders",
"Prims.unit",
"FStar.Stubs.Reflection.Types.binder",
"Prims.list",
"FStar.Pervasives.Native.option",
"FStar.Stubs.Reflection.Types.typ",
"FStar.Stubs.Reflection.V1.Builtins.term_eq",
"FStar.Stubs.Tactics.V1.Builtins.rewrite",
"Prims.bool",
"FStar.Tactics.V1.Derived.try_rewrite_equality",
"FStar.Reflection.V1.Formula.formula",
"FStar.Reflection.V1.Formula.term_as_formula",
"FStar.Reflection.V1.Derived.type_of_binder"
] | [
"recursion"
] | false | true | false | false | false | let rec try_rewrite_equality (x: term) (bs: binders) : Tac unit =
| match bs with
| [] -> ()
| x_t :: bs ->
match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ -> if term_eq x y then rewrite x_t else try_rewrite_equality x bs
| _ -> try_rewrite_equality x bs | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.bump_nth | val bump_nth (n: pos) : Tac unit | val bump_nth (n: pos) : Tac unit | let bump_nth (n:pos) : Tac unit =
// n-1 since goal numbering begins at 1
match extract_nth (n - 1) (goals ()) with
| None -> fail "bump_nth: not that many goals"
| Some (h, t) -> set_goals (h :: t) | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 37,
"end_line": 857,
"start_col": 0,
"start_line": 853
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x
let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y
let add_elem (t : unit -> Tac 'a) : Tac 'a = focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x
)
)
(*
* Specialize a function by partially evaluating it
* For example:
* let rec foo (l:list int) (x:int) :St int =
match l with
| [] -> x
| hd::tl -> x + foo tl x
let f :int -> St int = synth_by_tactic (specialize (foo [1; 2]) [%`foo])
* would make the definition of f as x + x + x
*
* f is the term that needs to be specialized
* l is the list of names to be delta-ed
*)
let specialize (#a:Type) (f:a) (l:list string) :unit -> Tac unit
= fun () -> solve_then (fun () -> exact (quote f)) (fun () -> norm [delta_only l; iota; zeta])
let tlabel (l:string) =
match goals () with
| [] -> fail "tlabel: no goals"
| h::t ->
set_goals (set_label l h :: t)
let tlabel' (l:string) =
match goals () with
| [] -> fail "tlabel': no goals"
| h::t ->
let h = set_label (l ^ get_label h) h in
set_goals (h :: t)
let focus_all () : Tac unit =
set_goals (goals () @ smt_goals ());
set_smt_goals []
private
let rec extract_nth (n:nat) (l : list 'a) : option ('a * list 'a) =
match n, l with
| _, [] -> None
| 0, hd::tl -> Some (hd, tl)
| _, hd::tl -> begin
match extract_nth (n-1) tl with
| Some (hd', tl') -> Some (hd', hd::tl')
| None -> None
end | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | n: Prims.pos -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.pos",
"FStar.Tactics.V1.Derived.fail",
"Prims.unit",
"FStar.Stubs.Tactics.Types.goal",
"Prims.list",
"FStar.Stubs.Tactics.V1.Builtins.set_goals",
"Prims.Cons",
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.tuple2",
"FStar.Tactics.V1.Derived.extract_nth",
"Prims.op_Subtraction",
"FStar.Tactics.V1.Derived.goals"
] | [] | false | true | false | false | false | let bump_nth (n: pos) : Tac unit =
| match extract_nth (n - 1) (goals ()) with
| None -> fail "bump_nth: not that many goals"
| Some (h, t) -> set_goals (h :: t) | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.last | val last (x: list 'a) : Tac 'a | val last (x: list 'a) : Tac 'a | let rec last (x : list 'a) : Tac 'a =
match x with
| [] -> fail "last: empty list"
| [x] -> x
| _::xs -> last xs | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 22,
"end_line": 885,
"start_col": 8,
"start_line": 881
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x
let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y
let add_elem (t : unit -> Tac 'a) : Tac 'a = focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x
)
)
(*
* Specialize a function by partially evaluating it
* For example:
* let rec foo (l:list int) (x:int) :St int =
match l with
| [] -> x
| hd::tl -> x + foo tl x
let f :int -> St int = synth_by_tactic (specialize (foo [1; 2]) [%`foo])
* would make the definition of f as x + x + x
*
* f is the term that needs to be specialized
* l is the list of names to be delta-ed
*)
let specialize (#a:Type) (f:a) (l:list string) :unit -> Tac unit
= fun () -> solve_then (fun () -> exact (quote f)) (fun () -> norm [delta_only l; iota; zeta])
let tlabel (l:string) =
match goals () with
| [] -> fail "tlabel: no goals"
| h::t ->
set_goals (set_label l h :: t)
let tlabel' (l:string) =
match goals () with
| [] -> fail "tlabel': no goals"
| h::t ->
let h = set_label (l ^ get_label h) h in
set_goals (h :: t)
let focus_all () : Tac unit =
set_goals (goals () @ smt_goals ());
set_smt_goals []
private
let rec extract_nth (n:nat) (l : list 'a) : option ('a * list 'a) =
match n, l with
| _, [] -> None
| 0, hd::tl -> Some (hd, tl)
| _, hd::tl -> begin
match extract_nth (n-1) tl with
| Some (hd', tl') -> Some (hd', hd::tl')
| None -> None
end
let bump_nth (n:pos) : Tac unit =
// n-1 since goal numbering begins at 1
match extract_nth (n - 1) (goals ()) with
| None -> fail "bump_nth: not that many goals"
| Some (h, t) -> set_goals (h :: t)
let rec destruct_list (t : term) : Tac (list term) =
let head, args = collect_app t in
match inspect_ln head, args with
| Tv_FVar fv, [(a1, Q_Explicit); (a2, Q_Explicit)]
| Tv_FVar fv, [(_, Q_Implicit); (a1, Q_Explicit); (a2, Q_Explicit)] ->
if inspect_fv fv = cons_qn
then a1 :: destruct_list a2
else raise NotAListLiteral
| Tv_FVar fv, _ ->
if inspect_fv fv = nil_qn
then []
else raise NotAListLiteral
| _ ->
raise NotAListLiteral
private let get_match_body () : Tac term =
match unsquash_term (cur_goal ()) with
| None -> fail ""
| Some t -> match inspect_unascribe t with
| Tv_Match sc _ _ -> sc
| _ -> fail "Goal is not a match" | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: Prims.list 'a -> FStar.Tactics.Effect.Tac 'a | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.list",
"FStar.Tactics.V1.Derived.fail",
"FStar.Tactics.V1.Derived.last"
] | [
"recursion"
] | false | true | false | false | false | let rec last (x: list 'a) : Tac 'a =
| match x with
| [] -> fail "last: empty list"
| [x] -> x
| _ :: xs -> last xs | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.extract_nth | val extract_nth (n: nat) (l: list 'a) : option ('a * list 'a) | val extract_nth (n: nat) (l: list 'a) : option ('a * list 'a) | let rec extract_nth (n:nat) (l : list 'a) : option ('a * list 'a) =
match n, l with
| _, [] -> None
| 0, hd::tl -> Some (hd, tl)
| _, hd::tl -> begin
match extract_nth (n-1) tl with
| Some (hd', tl') -> Some (hd', hd::tl')
| None -> None
end | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 5,
"end_line": 851,
"start_col": 0,
"start_line": 843
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x
let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y
let add_elem (t : unit -> Tac 'a) : Tac 'a = focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x
)
)
(*
* Specialize a function by partially evaluating it
* For example:
* let rec foo (l:list int) (x:int) :St int =
match l with
| [] -> x
| hd::tl -> x + foo tl x
let f :int -> St int = synth_by_tactic (specialize (foo [1; 2]) [%`foo])
* would make the definition of f as x + x + x
*
* f is the term that needs to be specialized
* l is the list of names to be delta-ed
*)
let specialize (#a:Type) (f:a) (l:list string) :unit -> Tac unit
= fun () -> solve_then (fun () -> exact (quote f)) (fun () -> norm [delta_only l; iota; zeta])
let tlabel (l:string) =
match goals () with
| [] -> fail "tlabel: no goals"
| h::t ->
set_goals (set_label l h :: t)
let tlabel' (l:string) =
match goals () with
| [] -> fail "tlabel': no goals"
| h::t ->
let h = set_label (l ^ get_label h) h in
set_goals (h :: t)
let focus_all () : Tac unit =
set_goals (goals () @ smt_goals ());
set_smt_goals [] | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | n: Prims.nat -> l: Prims.list 'a -> FStar.Pervasives.Native.option ('a * Prims.list 'a) | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"Prims.list",
"FStar.Pervasives.Native.Mktuple2",
"Prims.int",
"FStar.Pervasives.Native.None",
"FStar.Pervasives.Native.tuple2",
"FStar.Pervasives.Native.Some",
"FStar.Tactics.V1.Derived.extract_nth",
"Prims.op_Subtraction",
"Prims.Cons",
"FStar.Pervasives.Native.option"
] | [
"recursion"
] | false | false | false | true | false | let rec extract_nth (n: nat) (l: list 'a) : option ('a * list 'a) =
| match n, l with
| _, [] -> None
| 0, hd :: tl -> Some (hd, tl)
| _, hd :: tl ->
match extract_nth (n - 1) tl with
| Some (hd', tl') -> Some (hd', hd :: tl')
| None -> None | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.get_match_body | val get_match_body: Prims.unit -> Tac term | val get_match_body: Prims.unit -> Tac term | let get_match_body () : Tac term =
match unsquash_term (cur_goal ()) with
| None -> fail ""
| Some t -> match inspect_unascribe t with
| Tv_Match sc _ _ -> sc
| _ -> fail "Goal is not a match" | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 46,
"end_line": 879,
"start_col": 8,
"start_line": 874
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x
let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y
let add_elem (t : unit -> Tac 'a) : Tac 'a = focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x
)
)
(*
* Specialize a function by partially evaluating it
* For example:
* let rec foo (l:list int) (x:int) :St int =
match l with
| [] -> x
| hd::tl -> x + foo tl x
let f :int -> St int = synth_by_tactic (specialize (foo [1; 2]) [%`foo])
* would make the definition of f as x + x + x
*
* f is the term that needs to be specialized
* l is the list of names to be delta-ed
*)
let specialize (#a:Type) (f:a) (l:list string) :unit -> Tac unit
= fun () -> solve_then (fun () -> exact (quote f)) (fun () -> norm [delta_only l; iota; zeta])
let tlabel (l:string) =
match goals () with
| [] -> fail "tlabel: no goals"
| h::t ->
set_goals (set_label l h :: t)
let tlabel' (l:string) =
match goals () with
| [] -> fail "tlabel': no goals"
| h::t ->
let h = set_label (l ^ get_label h) h in
set_goals (h :: t)
let focus_all () : Tac unit =
set_goals (goals () @ smt_goals ());
set_smt_goals []
private
let rec extract_nth (n:nat) (l : list 'a) : option ('a * list 'a) =
match n, l with
| _, [] -> None
| 0, hd::tl -> Some (hd, tl)
| _, hd::tl -> begin
match extract_nth (n-1) tl with
| Some (hd', tl') -> Some (hd', hd::tl')
| None -> None
end
let bump_nth (n:pos) : Tac unit =
// n-1 since goal numbering begins at 1
match extract_nth (n - 1) (goals ()) with
| None -> fail "bump_nth: not that many goals"
| Some (h, t) -> set_goals (h :: t)
let rec destruct_list (t : term) : Tac (list term) =
let head, args = collect_app t in
match inspect_ln head, args with
| Tv_FVar fv, [(a1, Q_Explicit); (a2, Q_Explicit)]
| Tv_FVar fv, [(_, Q_Implicit); (a1, Q_Explicit); (a2, Q_Explicit)] ->
if inspect_fv fv = cons_qn
then a1 :: destruct_list a2
else raise NotAListLiteral
| Tv_FVar fv, _ ->
if inspect_fv fv = nil_qn
then []
else raise NotAListLiteral
| _ ->
raise NotAListLiteral | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.unit -> FStar.Tactics.Effect.Tac FStar.Stubs.Reflection.Types.term | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.unit",
"FStar.Tactics.V1.Derived.fail",
"FStar.Stubs.Reflection.Types.term",
"FStar.Pervasives.Native.option",
"FStar.Stubs.Reflection.Types.match_returns_ascription",
"Prims.list",
"FStar.Stubs.Reflection.V1.Data.branch",
"FStar.Stubs.Reflection.V1.Data.term_view",
"Prims.b2t",
"FStar.Stubs.Reflection.V1.Data.notAscription",
"FStar.Tactics.V1.SyntaxHelpers.inspect_unascribe",
"FStar.Reflection.V1.Derived.unsquash_term",
"FStar.Tactics.V1.Derived.cur_goal",
"FStar.Stubs.Reflection.Types.typ"
] | [] | false | true | false | false | false | let get_match_body () : Tac term =
| match unsquash_term (cur_goal ()) with
| None -> fail ""
| Some t ->
match inspect_unascribe t with
| Tv_Match sc _ _ -> sc
| _ -> fail "Goal is not a match" | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.nth_binder | val nth_binder (i: int) : Tac binder | val nth_binder (i: int) : Tac binder | let nth_binder (i:int) : Tac binder =
let bs = cur_binders () in
let k : int = if i >= 0 then i else List.Tot.Base.length bs + i in
let k : nat = if k < 0 then fail "not enough binders" else k in
match List.Tot.Base.nth bs k with
| None -> fail "not enough binders"
| Some b -> b | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 15,
"end_line": 912,
"start_col": 0,
"start_line": 906
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x
let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y
let add_elem (t : unit -> Tac 'a) : Tac 'a = focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x
)
)
(*
* Specialize a function by partially evaluating it
* For example:
* let rec foo (l:list int) (x:int) :St int =
match l with
| [] -> x
| hd::tl -> x + foo tl x
let f :int -> St int = synth_by_tactic (specialize (foo [1; 2]) [%`foo])
* would make the definition of f as x + x + x
*
* f is the term that needs to be specialized
* l is the list of names to be delta-ed
*)
let specialize (#a:Type) (f:a) (l:list string) :unit -> Tac unit
= fun () -> solve_then (fun () -> exact (quote f)) (fun () -> norm [delta_only l; iota; zeta])
let tlabel (l:string) =
match goals () with
| [] -> fail "tlabel: no goals"
| h::t ->
set_goals (set_label l h :: t)
let tlabel' (l:string) =
match goals () with
| [] -> fail "tlabel': no goals"
| h::t ->
let h = set_label (l ^ get_label h) h in
set_goals (h :: t)
let focus_all () : Tac unit =
set_goals (goals () @ smt_goals ());
set_smt_goals []
private
let rec extract_nth (n:nat) (l : list 'a) : option ('a * list 'a) =
match n, l with
| _, [] -> None
| 0, hd::tl -> Some (hd, tl)
| _, hd::tl -> begin
match extract_nth (n-1) tl with
| Some (hd', tl') -> Some (hd', hd::tl')
| None -> None
end
let bump_nth (n:pos) : Tac unit =
// n-1 since goal numbering begins at 1
match extract_nth (n - 1) (goals ()) with
| None -> fail "bump_nth: not that many goals"
| Some (h, t) -> set_goals (h :: t)
let rec destruct_list (t : term) : Tac (list term) =
let head, args = collect_app t in
match inspect_ln head, args with
| Tv_FVar fv, [(a1, Q_Explicit); (a2, Q_Explicit)]
| Tv_FVar fv, [(_, Q_Implicit); (a1, Q_Explicit); (a2, Q_Explicit)] ->
if inspect_fv fv = cons_qn
then a1 :: destruct_list a2
else raise NotAListLiteral
| Tv_FVar fv, _ ->
if inspect_fv fv = nil_qn
then []
else raise NotAListLiteral
| _ ->
raise NotAListLiteral
private let get_match_body () : Tac term =
match unsquash_term (cur_goal ()) with
| None -> fail ""
| Some t -> match inspect_unascribe t with
| Tv_Match sc _ _ -> sc
| _ -> fail "Goal is not a match"
private let rec last (x : list 'a) : Tac 'a =
match x with
| [] -> fail "last: empty list"
| [x] -> x
| _::xs -> last xs
(** When the goal is [match e with | p1 -> e1 ... | pn -> en],
destruct it into [n] goals for each possible case, including an
hypothesis for [e] matching the corresponding pattern. *)
let branch_on_match () : Tac unit =
focus (fun () ->
let x = get_match_body () in
let _ = t_destruct x in
iterAll (fun () ->
let bs = repeat intro in
let b = last bs in (* this one is the equality *)
grewrite_eq b;
norm [iota])
)
(** When the argument [i] is non-negative, [nth_binder] grabs the nth
binder in the current goal. When it is negative, it grabs the (-i-1)th
binder counting from the end of the goal. That is, [nth_binder (-1)]
will return the last binder, [nth_binder (-2)] the second to last, and | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | i: Prims.int -> FStar.Tactics.Effect.Tac FStar.Stubs.Reflection.Types.binder | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.int",
"FStar.List.Tot.Base.nth",
"FStar.Stubs.Reflection.Types.binder",
"FStar.Tactics.V1.Derived.fail",
"Prims.nat",
"Prims.op_LessThan",
"Prims.bool",
"Prims.op_GreaterThanOrEqual",
"Prims.op_Addition",
"FStar.List.Tot.Base.length",
"FStar.Stubs.Reflection.Types.binders",
"FStar.Tactics.V1.Derived.cur_binders"
] | [] | false | true | false | false | false | let nth_binder (i: int) : Tac binder =
| let bs = cur_binders () in
let k:int = if i >= 0 then i else List.Tot.Base.length bs + i in
let k:nat = if k < 0 then fail "not enough binders" else k in
match List.Tot.Base.nth bs k with
| None -> fail "not enough binders"
| Some b -> b | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.mk_abs | val mk_abs (args: list binder) (t: term) : Tac term (decreases args) | val mk_abs (args: list binder) (t: term) : Tac term (decreases args) | let rec mk_abs (args : list binder) (t : term) : Tac term (decreases args) =
match args with
| [] -> t
| a :: args' ->
let t' = mk_abs args' t in
pack (Tv_Abs a t') | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 22,
"end_line": 937,
"start_col": 0,
"start_line": 932
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x
let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y
let add_elem (t : unit -> Tac 'a) : Tac 'a = focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x
)
)
(*
* Specialize a function by partially evaluating it
* For example:
* let rec foo (l:list int) (x:int) :St int =
match l with
| [] -> x
| hd::tl -> x + foo tl x
let f :int -> St int = synth_by_tactic (specialize (foo [1; 2]) [%`foo])
* would make the definition of f as x + x + x
*
* f is the term that needs to be specialized
* l is the list of names to be delta-ed
*)
let specialize (#a:Type) (f:a) (l:list string) :unit -> Tac unit
= fun () -> solve_then (fun () -> exact (quote f)) (fun () -> norm [delta_only l; iota; zeta])
let tlabel (l:string) =
match goals () with
| [] -> fail "tlabel: no goals"
| h::t ->
set_goals (set_label l h :: t)
let tlabel' (l:string) =
match goals () with
| [] -> fail "tlabel': no goals"
| h::t ->
let h = set_label (l ^ get_label h) h in
set_goals (h :: t)
let focus_all () : Tac unit =
set_goals (goals () @ smt_goals ());
set_smt_goals []
private
let rec extract_nth (n:nat) (l : list 'a) : option ('a * list 'a) =
match n, l with
| _, [] -> None
| 0, hd::tl -> Some (hd, tl)
| _, hd::tl -> begin
match extract_nth (n-1) tl with
| Some (hd', tl') -> Some (hd', hd::tl')
| None -> None
end
let bump_nth (n:pos) : Tac unit =
// n-1 since goal numbering begins at 1
match extract_nth (n - 1) (goals ()) with
| None -> fail "bump_nth: not that many goals"
| Some (h, t) -> set_goals (h :: t)
let rec destruct_list (t : term) : Tac (list term) =
let head, args = collect_app t in
match inspect_ln head, args with
| Tv_FVar fv, [(a1, Q_Explicit); (a2, Q_Explicit)]
| Tv_FVar fv, [(_, Q_Implicit); (a1, Q_Explicit); (a2, Q_Explicit)] ->
if inspect_fv fv = cons_qn
then a1 :: destruct_list a2
else raise NotAListLiteral
| Tv_FVar fv, _ ->
if inspect_fv fv = nil_qn
then []
else raise NotAListLiteral
| _ ->
raise NotAListLiteral
private let get_match_body () : Tac term =
match unsquash_term (cur_goal ()) with
| None -> fail ""
| Some t -> match inspect_unascribe t with
| Tv_Match sc _ _ -> sc
| _ -> fail "Goal is not a match"
private let rec last (x : list 'a) : Tac 'a =
match x with
| [] -> fail "last: empty list"
| [x] -> x
| _::xs -> last xs
(** When the goal is [match e with | p1 -> e1 ... | pn -> en],
destruct it into [n] goals for each possible case, including an
hypothesis for [e] matching the corresponding pattern. *)
let branch_on_match () : Tac unit =
focus (fun () ->
let x = get_match_body () in
let _ = t_destruct x in
iterAll (fun () ->
let bs = repeat intro in
let b = last bs in (* this one is the equality *)
grewrite_eq b;
norm [iota])
)
(** When the argument [i] is non-negative, [nth_binder] grabs the nth
binder in the current goal. When it is negative, it grabs the (-i-1)th
binder counting from the end of the goal. That is, [nth_binder (-1)]
will return the last binder, [nth_binder (-2)] the second to last, and
so on. *)
let nth_binder (i:int) : Tac binder =
let bs = cur_binders () in
let k : int = if i >= 0 then i else List.Tot.Base.length bs + i in
let k : nat = if k < 0 then fail "not enough binders" else k in
match List.Tot.Base.nth bs k with
| None -> fail "not enough binders"
| Some b -> b
exception Appears
(** Decides whether a top-level name [nm] syntactically
appears in the term [t]. *)
let name_appears_in (nm:name) (t:term) : Tac bool =
let ff (t : term) : Tac term =
match inspect_ln t with
| Tv_FVar fv ->
if inspect_fv fv = nm then
raise Appears;
t
| _ -> t
in
try ignore (V.visit_tm ff t); false with
| Appears -> true
| e -> raise e | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | args: Prims.list FStar.Stubs.Reflection.Types.binder -> t: FStar.Stubs.Reflection.Types.term
-> FStar.Tactics.Effect.Tac FStar.Stubs.Reflection.Types.term | FStar.Tactics.Effect.Tac | [
""
] | [] | [
"Prims.list",
"FStar.Stubs.Reflection.Types.binder",
"FStar.Stubs.Reflection.Types.term",
"FStar.Stubs.Tactics.V1.Builtins.pack",
"FStar.Stubs.Reflection.V1.Data.Tv_Abs",
"FStar.Tactics.V1.Derived.mk_abs"
] | [
"recursion"
] | false | true | false | false | false | let rec mk_abs (args: list binder) (t: term) : Tac term (decreases args) =
| match args with
| [] -> t
| a :: args' ->
let t' = mk_abs args' t in
pack (Tv_Abs a t') | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.tlabel | val tlabel : l: Prims.string -> FStar.Tactics.Effect.Tac Prims.unit | let tlabel (l:string) =
match goals () with
| [] -> fail "tlabel: no goals"
| h::t ->
set_goals (set_label l h :: t) | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 38,
"end_line": 829,
"start_col": 0,
"start_line": 825
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x
let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y
let add_elem (t : unit -> Tac 'a) : Tac 'a = focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x
)
)
(*
* Specialize a function by partially evaluating it
* For example:
* let rec foo (l:list int) (x:int) :St int =
match l with
| [] -> x
| hd::tl -> x + foo tl x
let f :int -> St int = synth_by_tactic (specialize (foo [1; 2]) [%`foo])
* would make the definition of f as x + x + x
*
* f is the term that needs to be specialized
* l is the list of names to be delta-ed
*)
let specialize (#a:Type) (f:a) (l:list string) :unit -> Tac unit
= fun () -> solve_then (fun () -> exact (quote f)) (fun () -> norm [delta_only l; iota; zeta]) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | l: Prims.string -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.string",
"FStar.Tactics.V1.Derived.fail",
"Prims.unit",
"FStar.Stubs.Tactics.Types.goal",
"Prims.list",
"FStar.Stubs.Tactics.V1.Builtins.set_goals",
"Prims.Cons",
"FStar.Stubs.Tactics.Types.set_label",
"FStar.Tactics.V1.Derived.goals"
] | [] | false | true | false | false | false | let tlabel (l: string) =
| match goals () with
| [] -> fail "tlabel: no goals"
| h :: t -> set_goals (set_label l h :: t) | false |
|
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.tlabel' | val tlabel' : l: Prims.string -> FStar.Tactics.Effect.Tac Prims.unit | let tlabel' (l:string) =
match goals () with
| [] -> fail "tlabel': no goals"
| h::t ->
let h = set_label (l ^ get_label h) h in
set_goals (h :: t) | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 26,
"end_line": 836,
"start_col": 0,
"start_line": 831
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x
let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y
let add_elem (t : unit -> Tac 'a) : Tac 'a = focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x
)
)
(*
* Specialize a function by partially evaluating it
* For example:
* let rec foo (l:list int) (x:int) :St int =
match l with
| [] -> x
| hd::tl -> x + foo tl x
let f :int -> St int = synth_by_tactic (specialize (foo [1; 2]) [%`foo])
* would make the definition of f as x + x + x
*
* f is the term that needs to be specialized
* l is the list of names to be delta-ed
*)
let specialize (#a:Type) (f:a) (l:list string) :unit -> Tac unit
= fun () -> solve_then (fun () -> exact (quote f)) (fun () -> norm [delta_only l; iota; zeta])
let tlabel (l:string) =
match goals () with
| [] -> fail "tlabel: no goals"
| h::t ->
set_goals (set_label l h :: t) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | l: Prims.string -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.string",
"FStar.Tactics.V1.Derived.fail",
"Prims.unit",
"FStar.Stubs.Tactics.Types.goal",
"Prims.list",
"FStar.Stubs.Tactics.V1.Builtins.set_goals",
"Prims.Cons",
"FStar.Stubs.Tactics.Types.set_label",
"Prims.op_Hat",
"FStar.Stubs.Tactics.Types.get_label",
"FStar.Tactics.V1.Derived.goals"
] | [] | false | true | false | false | false | let tlabel' (l: string) =
| match goals () with
| [] -> fail "tlabel': no goals"
| h :: t ->
let h = set_label (l ^ get_label h) h in
set_goals (h :: t) | false |
|
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.destruct_list | val destruct_list (t: term) : Tac (list term) | val destruct_list (t: term) : Tac (list term) | let rec destruct_list (t : term) : Tac (list term) =
let head, args = collect_app t in
match inspect_ln head, args with
| Tv_FVar fv, [(a1, Q_Explicit); (a2, Q_Explicit)]
| Tv_FVar fv, [(_, Q_Implicit); (a1, Q_Explicit); (a2, Q_Explicit)] ->
if inspect_fv fv = cons_qn
then a1 :: destruct_list a2
else raise NotAListLiteral
| Tv_FVar fv, _ ->
if inspect_fv fv = nil_qn
then []
else raise NotAListLiteral
| _ ->
raise NotAListLiteral | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 27,
"end_line": 872,
"start_col": 0,
"start_line": 859
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*)
val apply_squash_or_lem : d:nat -> term -> Tac unit
let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end
(* `m` is for `magic` *)
let mapply (t : term) : Tac unit =
apply_squash_or_lem 10 t
private
let admit_dump_t () : Tac unit =
dump "Admitting";
apply (`admit)
val admit_dump : #a:Type -> (#[admit_dump_t ()] x : (unit -> Admit a)) -> unit -> Admit a
let admit_dump #a #x () = x ()
private
let magic_dump_t () : Tac unit =
dump "Admitting";
apply (`magic);
exact (`());
()
val magic_dump : #a:Type -> (#[magic_dump_t ()] x : a) -> unit -> Tot a
let magic_dump #a #x () = x
let change_with t1 t2 : Tac unit =
focus (fun () ->
grewrite t1 t2;
iseq [idtac; trivial]
)
let change_sq (t1 : term) : Tac unit =
change (mk_e_app (`squash) [t1])
let finish_by (t : unit -> Tac 'a) : Tac 'a =
let x = t () in
or_else qed (fun () -> fail "finish_by: not finished");
x
let solve_then #a #b (t1 : unit -> Tac a) (t2 : a -> Tac b) : Tac b =
dup ();
let x = focus (fun () -> finish_by t1) in
let y = t2 x in
trefl ();
y
let add_elem (t : unit -> Tac 'a) : Tac 'a = focus (fun () ->
apply (`Cons);
focus (fun () ->
let x = t () in
qed ();
x
)
)
(*
* Specialize a function by partially evaluating it
* For example:
* let rec foo (l:list int) (x:int) :St int =
match l with
| [] -> x
| hd::tl -> x + foo tl x
let f :int -> St int = synth_by_tactic (specialize (foo [1; 2]) [%`foo])
* would make the definition of f as x + x + x
*
* f is the term that needs to be specialized
* l is the list of names to be delta-ed
*)
let specialize (#a:Type) (f:a) (l:list string) :unit -> Tac unit
= fun () -> solve_then (fun () -> exact (quote f)) (fun () -> norm [delta_only l; iota; zeta])
let tlabel (l:string) =
match goals () with
| [] -> fail "tlabel: no goals"
| h::t ->
set_goals (set_label l h :: t)
let tlabel' (l:string) =
match goals () with
| [] -> fail "tlabel': no goals"
| h::t ->
let h = set_label (l ^ get_label h) h in
set_goals (h :: t)
let focus_all () : Tac unit =
set_goals (goals () @ smt_goals ());
set_smt_goals []
private
let rec extract_nth (n:nat) (l : list 'a) : option ('a * list 'a) =
match n, l with
| _, [] -> None
| 0, hd::tl -> Some (hd, tl)
| _, hd::tl -> begin
match extract_nth (n-1) tl with
| Some (hd', tl') -> Some (hd', hd::tl')
| None -> None
end
let bump_nth (n:pos) : Tac unit =
// n-1 since goal numbering begins at 1
match extract_nth (n - 1) (goals ()) with
| None -> fail "bump_nth: not that many goals"
| Some (h, t) -> set_goals (h :: t) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | t: FStar.Stubs.Reflection.Types.term
-> FStar.Tactics.Effect.Tac (Prims.list FStar.Stubs.Reflection.Types.term) | FStar.Tactics.Effect.Tac | [] | [] | [
"FStar.Stubs.Reflection.Types.term",
"Prims.list",
"FStar.Stubs.Reflection.V1.Data.argv",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Stubs.Reflection.V1.Data.term_view",
"FStar.Pervasives.Native.tuple2",
"FStar.Stubs.Reflection.V1.Data.aqualv",
"FStar.Stubs.Reflection.V1.Builtins.inspect_ln",
"FStar.Stubs.Reflection.Types.fv",
"Prims.op_Equality",
"Prims.string",
"FStar.Stubs.Reflection.V1.Builtins.inspect_fv",
"FStar.Reflection.Const.cons_qn",
"Prims.Cons",
"FStar.Tactics.V1.Derived.destruct_list",
"Prims.bool",
"FStar.Tactics.Effect.raise",
"FStar.Stubs.Tactics.Common.NotAListLiteral",
"FStar.Reflection.Const.nil_qn",
"Prims.Nil",
"FStar.Tactics.V1.SyntaxHelpers.collect_app"
] | [
"recursion"
] | false | true | false | false | false | let rec destruct_list (t: term) : Tac (list term) =
| let head, args = collect_app t in
match inspect_ln head, args with
| Tv_FVar fv, [a1, Q_Explicit ; a2, Q_Explicit]
| Tv_FVar fv, [_, Q_Implicit ; a1, Q_Explicit ; a2, Q_Explicit] ->
if inspect_fv fv = cons_qn then a1 :: destruct_list a2 else raise NotAListLiteral
| Tv_FVar fv, _ -> if inspect_fv fv = nil_qn then [] else raise NotAListLiteral
| _ -> raise NotAListLiteral | false |
FStar.Tactics.V1.Derived.fst | FStar.Tactics.V1.Derived.apply_squash_or_lem | val apply_squash_or_lem : d:nat -> term -> Tac unit | val apply_squash_or_lem : d:nat -> term -> Tac unit | let rec apply_squash_or_lem d t =
(* Before anything, try a vanilla apply and apply_lemma *)
try apply t with | _ ->
try apply (`FStar.Squash.return_squash); apply t with | _ ->
try apply_lemma t with | _ ->
// Fuel cutoff, just in case.
if d <= 0 then fail "mapply: out of fuel" else begin
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
begin
let post = `((`#post) ()) in (* unthunk *)
let post = norm_term [] post in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
| C_Total rt ->
begin match unsquash_term rt with
(* If the function returns a squash, just apply it, since our goals are squashed *)
| Some rt ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
fail "mapply: can't apply (1)"
end
(* If not, we can try to introduce the squash ourselves first *)
| None ->
// DUPLICATED, refactor!
begin
let rt = norm_term [] rt in
(* Is the lemma an implication? We can try to intro *)
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d-1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t
end
end
| _ -> fail "mapply: can't apply (2)"
end | {
"file_name": "ulib/FStar.Tactics.V1.Derived.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 7,
"end_line": 752,
"start_col": 0,
"start_line": 693
} | (*
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.Tactics.V1.Derived
open FStar.Reflection.V1
open FStar.Reflection.V1.Formula
open FStar.Tactics.Effect
open FStar.Stubs.Tactics.Types
open FStar.Stubs.Tactics.Result
open FStar.Tactics.Util
open FStar.Stubs.Tactics.V1.Builtins
open FStar.Tactics.V1.SyntaxHelpers
open FStar.VConfig
module L = FStar.List.Tot.Base
module V = FStar.Tactics.Visit
private let (@) = L.op_At
let name_of_bv (bv : bv) : Tac string =
unseal ((inspect_bv bv).bv_ppname)
let bv_to_string (bv : bv) : Tac string =
(* Could also print type...? *)
name_of_bv bv
let name_of_binder (b : binder) : Tac string =
name_of_bv (bv_of_binder b)
let binder_to_string (b : binder) : Tac string =
bv_to_string (bv_of_binder b) //TODO: print aqual, attributes
exception Goal_not_trivial
let goals () : Tac (list goal) = goals_of (get ())
let smt_goals () : Tac (list goal) = smt_goals_of (get ())
let fail (#a:Type) (m:string)
: TAC a (fun ps post -> post (Failed (TacticFailure m) ps))
= raise #a (TacticFailure m)
let fail_silently (#a:Type) (m:string)
: TAC a (fun _ post -> forall ps. post (Failed (TacticFailure m) ps))
= set_urgency 0;
raise #a (TacticFailure m)
(** Return the current *goal*, not its type. (Ignores SMT goals) *)
let _cur_goal () : Tac goal =
match goals () with
| [] -> fail "no more goals"
| g::_ -> g
(** [cur_env] returns the current goal's environment *)
let cur_env () : Tac env = goal_env (_cur_goal ())
(** [cur_goal] returns the current goal's type *)
let cur_goal () : Tac typ = goal_type (_cur_goal ())
(** [cur_witness] returns the current goal's witness *)
let cur_witness () : Tac term = goal_witness (_cur_goal ())
(** [cur_goal_safe] will always return the current goal, without failing.
It must be statically verified that there indeed is a goal in order to
call it. *)
let cur_goal_safe () : TacH goal (requires (fun ps -> ~(goals_of ps == [])))
(ensures (fun ps0 r -> exists g. r == Success g ps0))
= match goals_of (get ()) with
| g :: _ -> g
(** [cur_binders] returns the list of binders in the current goal. *)
let cur_binders () : Tac binders =
binders_of_env (cur_env ())
(** Set the guard policy only locally, without affecting calling code *)
let with_policy pol (f : unit -> Tac 'a) : Tac 'a =
let old_pol = get_guard_policy () in
set_guard_policy pol;
let r = f () in
set_guard_policy old_pol;
r
(** [exact e] will solve a goal [Gamma |- w : t] if [e] has type exactly
[t] in [Gamma]. *)
let exact (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true false t)
(** [exact_with_ref e] will solve a goal [Gamma |- w : t] if [e] has
type [t'] where [t'] is a subtype of [t] in [Gamma]. This is a more
flexible variant of [exact]. *)
let exact_with_ref (t : term) : Tac unit =
with_policy SMT (fun () -> t_exact true true t)
let trivial () : Tac unit =
norm [iota; zeta; reify_; delta; primops; simplify; unmeta];
let g = cur_goal () in
match term_as_formula g with
| True_ -> exact (`())
| _ -> raise Goal_not_trivial
(* Another hook to just run a tactic without goals, just by reusing `with_tactic` *)
let run_tactic (t:unit -> Tac unit)
: Pure unit
(requires (set_range_of (with_tactic (fun () -> trivial (); t ()) (squash True)) (range_of t)))
(ensures (fun _ -> True))
= ()
(** Ignore the current goal. If left unproven, this will fail after
the tactic finishes. *)
let dismiss () : Tac unit =
match goals () with
| [] -> fail "dismiss: no more goals"
| _::gs -> set_goals gs
(** Flip the order of the first two goals. *)
let flip () : Tac unit =
let gs = goals () in
match goals () with
| [] | [_] -> fail "flip: less than two goals"
| g1::g2::gs -> set_goals (g2::g1::gs)
(** Succeed if there are no more goals left, and fail otherwise. *)
let qed () : Tac unit =
match goals () with
| [] -> ()
| _ -> fail "qed: not done!"
(** [debug str] is similar to [print str], but will only print the message
if the [--debug] option was given for the current module AND
[--debug_level Tac] is on. *)
let debug (m:string) : Tac unit =
if debugging () then print m
(** [smt] will mark the current goal for being solved through the SMT.
This does not immediately run the SMT: it just dumps the goal in the
SMT bin. Note, if you dump a proof-relevant goal there, the engine will
later raise an error. *)
let smt () : Tac unit =
match goals (), smt_goals () with
| [], _ -> fail "smt: no active goals"
| g::gs, gs' ->
begin
set_goals gs;
set_smt_goals (g :: gs')
end
let idtac () : Tac unit = ()
(** Push the current goal to the back. *)
let later () : Tac unit =
match goals () with
| g::gs -> set_goals (gs @ [g])
| _ -> fail "later: no goals"
(** [apply f] will attempt to produce a solution to the goal by an application
of [f] to any amount of arguments (which need to be solved as further goals).
The amount of arguments introduced is the least such that [f a_i] unifies
with the goal's type. *)
let apply (t : term) : Tac unit =
t_apply true false false t
let apply_noinst (t : term) : Tac unit =
t_apply true true false t
(** [apply_lemma l] will solve a goal of type [squash phi] when [l] is a
Lemma ensuring [phi]. The arguments to [l] and its requires clause are
introduced as new goals. As a small optimization, [unit] arguments are
discharged by the engine. Just a thin wrapper around [t_apply_lemma]. *)
let apply_lemma (t : term) : Tac unit =
t_apply_lemma false false t
(** See docs for [t_trefl] *)
let trefl () : Tac unit =
t_trefl false
(** See docs for [t_trefl] *)
let trefl_guard () : Tac unit =
t_trefl true
(** See docs for [t_commute_applied_match] *)
let commute_applied_match () : Tac unit =
t_commute_applied_match ()
(** Similar to [apply_lemma], but will not instantiate uvars in the
goal while applying. *)
let apply_lemma_noinst (t : term) : Tac unit =
t_apply_lemma true false t
let apply_lemma_rw (t : term) : Tac unit =
t_apply_lemma false true t
(** [apply_raw f] is like [apply], but will ask for all arguments
regardless of whether they appear free in further goals. See the
explanation in [t_apply]. *)
let apply_raw (t : term) : Tac unit =
t_apply false false false t
(** Like [exact], but allows for the term [e] to have a type [t] only
under some guard [g], adding the guard as a goal. *)
let exact_guard (t : term) : Tac unit =
with_policy Goal (fun () -> t_exact true false t)
(** (TODO: explain better) When running [pointwise tau] For every
subterm [t'] of the goal's type [t], the engine will build a goal [Gamma
|= t' == ?u] and run [tau] on it. When the tactic proves the goal,
the engine will rewrite [t'] for [?u] in the original goal type. This
is done for every subterm, bottom-up. This allows to recurse over an
unknown goal type. By inspecting the goal, the [tau] can then decide
what to do (to not do anything, use [trefl]). *)
let t_pointwise (d:direction) (tau : unit -> Tac unit) : Tac unit =
let ctrl (t:term) : Tac (bool & ctrl_flag) =
true, Continue
in
let rw () : Tac unit =
tau ()
in
ctrl_rewrite d ctrl rw
(** [topdown_rewrite ctrl rw] is used to rewrite those sub-terms [t]
of the goal on which [fst (ctrl t)] returns true.
On each such sub-term, [rw] is presented with an equality of goal
of the form [Gamma |= t == ?u]. When [rw] proves the goal,
the engine will rewrite [t] for [?u] in the original goal
type.
The goal formula is traversed top-down and the traversal can be
controlled by [snd (ctrl t)]:
When [snd (ctrl t) = 0], the traversal continues down through the
position in the goal term.
When [snd (ctrl t) = 1], the traversal continues to the next
sub-tree of the goal.
When [snd (ctrl t) = 2], no more rewrites are performed in the
goal.
*)
let topdown_rewrite (ctrl : term -> Tac (bool * int))
(rw:unit -> Tac unit) : Tac unit
= let ctrl' (t:term) : Tac (bool & ctrl_flag) =
let b, i = ctrl t in
let f =
match i with
| 0 -> Continue
| 1 -> Skip
| 2 -> Abort
| _ -> fail "topdown_rewrite: bad value from ctrl"
in
b, f
in
ctrl_rewrite TopDown ctrl' rw
let pointwise (tau : unit -> Tac unit) : Tac unit = t_pointwise BottomUp tau
let pointwise' (tau : unit -> Tac unit) : Tac unit = t_pointwise TopDown tau
let cur_module () : Tac name =
moduleof (top_env ())
let open_modules () : Tac (list name) =
env_open_modules (top_env ())
let fresh_uvar (o : option typ) : Tac term =
let e = cur_env () in
uvar_env e o
let unify (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_env e t1 t2
let unify_guard (t1 t2 : term) : Tac bool =
let e = cur_env () in
unify_guard_env e t1 t2
let tmatch (t1 t2 : term) : Tac bool =
let e = cur_env () in
match_env e t1 t2
(** [divide n t1 t2] will split the current set of goals into the [n]
first ones, and the rest. It then runs [t1] on the first set, and [t2]
on the second, returning both results (and concatenating remaining goals). *)
let divide (n:int) (l : unit -> Tac 'a) (r : unit -> Tac 'b) : Tac ('a * 'b) =
if n < 0 then
fail "divide: negative n";
let gs, sgs = goals (), smt_goals () in
let gs1, gs2 = List.Tot.Base.splitAt n gs in
set_goals gs1; set_smt_goals [];
let x = l () in
let gsl, sgsl = goals (), smt_goals () in
set_goals gs2; set_smt_goals [];
let y = r () in
let gsr, sgsr = goals (), smt_goals () in
set_goals (gsl @ gsr); set_smt_goals (sgs @ sgsl @ sgsr);
(x, y)
let rec iseq (ts : list (unit -> Tac unit)) : Tac unit =
match ts with
| t::ts -> let _ = divide 1 t (fun () -> iseq ts) in ()
| [] -> ()
(** [focus t] runs [t ()] on the current active goal, hiding all others
and restoring them at the end. *)
let focus (t : unit -> Tac 'a) : Tac 'a =
match goals () with
| [] -> fail "focus: no goals"
| g::gs ->
let sgs = smt_goals () in
set_goals [g]; set_smt_goals [];
let x = t () in
set_goals (goals () @ gs); set_smt_goals (smt_goals () @ sgs);
x
(** Similar to [dump], but only dumping the current goal. *)
let dump1 (m : string) = focus (fun () -> dump m)
let rec mapAll (t : unit -> Tac 'a) : Tac (list 'a) =
match goals () with
| [] -> []
| _::_ -> let (h, t) = divide 1 t (fun () -> mapAll t) in h::t
let rec iterAll (t : unit -> Tac unit) : Tac unit =
(* Could use mapAll, but why even build that list *)
match goals () with
| [] -> ()
| _::_ -> let _ = divide 1 t (fun () -> iterAll t) in ()
let iterAllSMT (t : unit -> Tac unit) : Tac unit =
let gs, sgs = goals (), smt_goals () in
set_goals sgs;
set_smt_goals [];
iterAll t;
let gs', sgs' = goals (), smt_goals () in
set_goals gs;
set_smt_goals (gs'@sgs')
(** Runs tactic [t1] on the current goal, and then tactic [t2] on *each*
subgoal produced by [t1]. Each invocation of [t2] runs on a proofstate
with a single goal (they're "focused"). *)
let seq (f : unit -> Tac unit) (g : unit -> Tac unit) : Tac unit =
focus (fun () -> f (); iterAll g)
let exact_args (qs : list aqualv) (t : term) : Tac unit =
focus (fun () ->
let n = List.Tot.Base.length qs in
let uvs = repeatn n (fun () -> fresh_uvar None) in
let t' = mk_app t (zip uvs qs) in
exact t';
iter (fun uv -> if is_uvar uv
then unshelve uv
else ()) (L.rev uvs)
)
let exact_n (n : int) (t : term) : Tac unit =
exact_args (repeatn n (fun () -> Q_Explicit)) t
(** [ngoals ()] returns the number of goals *)
let ngoals () : Tac int = List.Tot.Base.length (goals ())
(** [ngoals_smt ()] returns the number of SMT goals *)
let ngoals_smt () : Tac int = List.Tot.Base.length (smt_goals ())
(* Create a fresh bound variable (bv), using a generic name. See also
[fresh_bv_named]. *)
let fresh_bv () : Tac bv =
(* These bvs are fresh anyway through a separate counter,
* but adding the integer allows for more readability when
* generating code *)
let i = fresh () in
fresh_bv_named ("x" ^ string_of_int i)
let fresh_binder_named nm t : Tac binder =
mk_binder (fresh_bv_named nm) t
let fresh_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_binder_named ("x" ^ string_of_int i) t
let fresh_implicit_binder_named nm t : Tac binder =
mk_implicit_binder (fresh_bv_named nm) t
let fresh_implicit_binder t : Tac binder =
(* See comment in fresh_bv *)
let i = fresh () in
fresh_implicit_binder_named ("x" ^ string_of_int i) t
let guard (b : bool) : TacH unit (requires (fun _ -> True))
(ensures (fun ps r -> if b
then Success? r /\ Success?.ps r == ps
else Failed? r))
(* ^ the proofstate on failure is not exactly equal (has the psc set) *)
=
if not b then
fail "guard failed"
else ()
let try_with (f : unit -> Tac 'a) (h : exn -> Tac 'a) : Tac 'a =
match catch f with
| Inl e -> h e
| Inr x -> x
let trytac (t : unit -> Tac 'a) : Tac (option 'a) =
try Some (t ())
with
| _ -> None
let or_else (#a:Type) (t1 : unit -> Tac a) (t2 : unit -> Tac a) : Tac a =
try t1 ()
with | _ -> t2 ()
val (<|>) : (unit -> Tac 'a) ->
(unit -> Tac 'a) ->
(unit -> Tac 'a)
let (<|>) t1 t2 = fun () -> or_else t1 t2
let first (ts : list (unit -> Tac 'a)) : Tac 'a =
L.fold_right (<|>) ts (fun () -> fail "no tactics to try") ()
let rec repeat (#a:Type) (t : unit -> Tac a) : Tac (list a) =
match catch t with
| Inl _ -> []
| Inr x -> x :: repeat t
let repeat1 (#a:Type) (t : unit -> Tac a) : Tac (list a) =
t () :: repeat t
let repeat' (f : unit -> Tac 'a) : Tac unit =
let _ = repeat f in ()
let norm_term (s : list norm_step) (t : term) : Tac term =
let e =
try cur_env ()
with | _ -> top_env ()
in
norm_term_env e s t
(** Join all of the SMT goals into one. This helps when all of them are
expected to be similar, and therefore easier to prove at once by the SMT
solver. TODO: would be nice to try to join them in a more meaningful
way, as the order can matter. *)
let join_all_smt_goals () =
let gs, sgs = goals (), smt_goals () in
set_smt_goals [];
set_goals sgs;
repeat' join;
let sgs' = goals () in // should be a single one
set_goals gs;
set_smt_goals sgs'
let discard (tau : unit -> Tac 'a) : unit -> Tac unit =
fun () -> let _ = tau () in ()
// TODO: do we want some value out of this?
let rec repeatseq (#a:Type) (t : unit -> Tac a) : Tac unit =
let _ = trytac (fun () -> (discard t) `seq` (discard (fun () -> repeatseq t))) in ()
let tadmit () = tadmit_t (`())
let admit1 () : Tac unit =
tadmit ()
let admit_all () : Tac unit =
let _ = repeat tadmit in
()
(** [is_guard] returns whether the current goal arose from a typechecking guard *)
let is_guard () : Tac bool =
Stubs.Tactics.Types.is_guard (_cur_goal ())
let skip_guard () : Tac unit =
if is_guard ()
then smt ()
else fail ""
let guards_to_smt () : Tac unit =
let _ = repeat skip_guard in
()
let simpl () : Tac unit = norm [simplify; primops]
let whnf () : Tac unit = norm [weak; hnf; primops; delta]
let compute () : Tac unit = norm [primops; iota; delta; zeta]
let intros () : Tac (list binder) = repeat intro
let intros' () : Tac unit = let _ = intros () in ()
let destruct tm : Tac unit = let _ = t_destruct tm in ()
let destruct_intros tm : Tac unit = seq (fun () -> let _ = t_destruct tm in ()) intros'
private val __cut : (a:Type) -> (b:Type) -> (a -> b) -> a -> b
private let __cut a b f x = f x
let tcut (t:term) : Tac binder =
let g = cur_goal () in
let tt = mk_e_app (`__cut) [t; g] in
apply tt;
intro ()
let pose (t:term) : Tac binder =
apply (`__cut);
flip ();
exact t;
intro ()
let intro_as (s:string) : Tac binder =
let b = intro () in
rename_to b s
let pose_as (s:string) (t:term) : Tac binder =
let b = pose t in
rename_to b s
let for_each_binder (f : binder -> Tac 'a) : Tac (list 'a) =
map f (cur_binders ())
let rec revert_all (bs:binders) : Tac unit =
match bs with
| [] -> ()
| _::tl -> revert ();
revert_all tl
(* Some syntax utility functions *)
let bv_to_term (bv : bv) : Tac term = pack (Tv_Var bv)
[@@coercion]
let binder_to_term (b : binder) : Tac term =
let bview = inspect_binder b in
bv_to_term bview.binder_bv
let binder_sort (b : binder) : Tac typ =
(inspect_binder b).binder_sort
// Cannot define this inside `assumption` due to #1091
private
let rec __assumption_aux (bs : binders) : Tac unit =
match bs with
| [] ->
fail "no assumption matches goal"
| b::bs ->
let t = binder_to_term b in
try exact t with | _ ->
try (apply (`FStar.Squash.return_squash);
exact t) with | _ ->
__assumption_aux bs
let assumption () : Tac unit =
__assumption_aux (cur_binders ())
let destruct_equality_implication (t:term) : Tac (option (formula * term)) =
match term_as_formula t with
| Implies lhs rhs ->
let lhs = term_as_formula' lhs in
begin match lhs with
| Comp (Eq _) _ _ -> Some (lhs, rhs)
| _ -> None
end
| _ -> None
private
let __eq_sym #t (a b : t) : Lemma ((a == b) == (b == a)) =
FStar.PropositionalExtensionality.apply (a==b) (b==a)
(** Like [rewrite], but works with equalities [v == e] and [e == v] *)
let rewrite' (b:binder) : Tac unit =
((fun () -> rewrite b)
<|> (fun () -> binder_retype b;
apply_lemma (`__eq_sym);
rewrite b)
<|> (fun () -> fail "rewrite' failed"))
()
let rec try_rewrite_equality (x:term) (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs ->
begin match term_as_formula (type_of_binder x_t) with
| Comp (Eq _) y _ ->
if term_eq x y
then rewrite x_t
else try_rewrite_equality x bs
| _ ->
try_rewrite_equality x bs
end
let rec rewrite_all_context_equalities (bs:binders) : Tac unit =
match bs with
| [] -> ()
| x_t::bs -> begin
(try rewrite x_t with | _ -> ());
rewrite_all_context_equalities bs
end
let rewrite_eqs_from_context () : Tac unit =
rewrite_all_context_equalities (cur_binders ())
let rewrite_equality (t:term) : Tac unit =
try_rewrite_equality t (cur_binders ())
let unfold_def (t:term) : Tac unit =
match inspect t with
| Tv_FVar fv ->
let n = implode_qn (inspect_fv fv) in
norm [delta_fully [n]]
| _ -> fail "unfold_def: term is not a fv"
(** Rewrites left-to-right, and bottom-up, given a set of lemmas stating
equalities. The lemmas need to prove *propositional* equalities, that
is, using [==]. *)
let l_to_r (lems:list term) : Tac unit =
let first_or_trefl () : Tac unit =
fold_left (fun k l () ->
(fun () -> apply_lemma_rw l)
`or_else` k)
trefl lems () in
pointwise first_or_trefl
let mk_squash (t : term) : term =
let sq : term = pack_ln (Tv_FVar (pack_fv squash_qn)) in
mk_e_app sq [t]
let mk_sq_eq (t1 t2 : term) : term =
let eq : term = pack_ln (Tv_FVar (pack_fv eq2_qn)) in
mk_squash (mk_e_app eq [t1; t2])
(** Rewrites all appearances of a term [t1] in the goal into [t2].
Creates a new goal for [t1 == t2]. *)
let grewrite (t1 t2 : term) : Tac unit =
let e = tcut (mk_sq_eq t1 t2) in
let e = pack_ln (Tv_Var (bv_of_binder e)) in
pointwise (fun () ->
(* If the LHS is a uvar, do nothing, so we do not instantiate it. *)
let is_uvar =
match term_as_formula (cur_goal()) with
| Comp (Eq _) lhs rhs ->
(match inspect_ln lhs with
| Tv_Uvar _ _ -> true
| _ -> false)
| _ -> false
in
if is_uvar
then trefl ()
else try exact e with | _ -> trefl ())
private
let __un_sq_eq (#a:Type) (x y : a) (_ : (x == y)) : Lemma (x == y) = ()
(** A wrapper to [grewrite] which takes a binder of an equality type *)
let grewrite_eq (b:binder) : Tac unit =
match term_as_formula (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> exact (binder_to_term b))]
| _ ->
begin match term_as_formula' (type_of_binder b) with
| Comp (Eq _) l r ->
grewrite l r;
iseq [idtac; (fun () -> apply_lemma (`__un_sq_eq);
exact (binder_to_term b))]
| _ ->
fail "grewrite_eq: binder type is not an equality"
end
private val push1 : (#p:Type) -> (#q:Type) ->
squash (p ==> q) ->
squash p ->
squash q
private let push1 #p #q f u = ()
private val push1' : (#p:Type) -> (#q:Type) ->
(p ==> q) ->
squash p ->
squash q
private let push1' #p #q f u = ()
(*
* Some easier applying, which should prevent frustration
* (or cause more when it doesn't do what you wanted to)
*) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Tactics.Visit.fst.checked",
"FStar.Tactics.V1.SyntaxHelpers.fst.checked",
"FStar.Tactics.Util.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Stubs.Tactics.V1.Builtins.fsti.checked",
"FStar.Stubs.Tactics.Types.fsti.checked",
"FStar.Stubs.Tactics.Result.fsti.checked",
"FStar.Squash.fsti.checked",
"FStar.Reflection.V1.Formula.fst.checked",
"FStar.Reflection.V1.fst.checked",
"FStar.Range.fsti.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Tactics.V1.Derived.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.Tactics.Visit",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot.Base",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1.SyntaxHelpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Result",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Stubs.Tactics.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | d: Prims.nat -> t: FStar.Stubs.Reflection.Types.term -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.nat",
"FStar.Stubs.Reflection.Types.term",
"FStar.Tactics.V1.Derived.try_with",
"Prims.unit",
"FStar.Tactics.V1.Derived.apply",
"Prims.exn",
"FStar.Tactics.V1.Derived.apply_lemma",
"Prims.op_LessThanOrEqual",
"FStar.Tactics.V1.Derived.fail",
"Prims.bool",
"Prims.list",
"FStar.Stubs.Reflection.Types.typ",
"FStar.Stubs.Reflection.Types.comp",
"FStar.Stubs.Reflection.V1.Builtins.inspect_comp",
"FStar.Tactics.V1.Derived.apply_squash_or_lem",
"Prims.op_Subtraction",
"FStar.Reflection.V1.Formula.formula",
"FStar.Reflection.V1.Formula.term_as_formula'",
"FStar.Tactics.V1.Derived.norm_term",
"Prims.Nil",
"FStar.Pervasives.norm_step",
"FStar.Reflection.V1.Derived.unsquash_term",
"FStar.Stubs.Reflection.V1.Data.comp_view",
"FStar.Pervasives.Native.tuple2",
"FStar.Tactics.V1.SyntaxHelpers.collect_arr",
"FStar.Stubs.Tactics.V1.Builtins.tc",
"FStar.Stubs.Reflection.Types.env",
"FStar.Tactics.V1.Derived.cur_env"
] | [
"recursion"
] | false | true | false | false | false | let rec apply_squash_or_lem d t =
| try apply t
with
| _ ->
try
(apply (`FStar.Squash.return_squash);
apply t)
with
| _ ->
try apply_lemma t
with
| _ ->
if d <= 0
then fail "mapply: out of fuel"
else
let ty = tc (cur_env ()) t in
let tys, c = collect_arr ty in
match inspect_comp c with
| C_Lemma pre post _ ->
let post = `((`#post) ()) in
let post = norm_term [] post in
(match term_as_formula' post with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d - 1) t
| _ -> fail "mapply: can't apply (1)")
| C_Total rt ->
(match unsquash_term rt with
| Some rt ->
let rt = norm_term [] rt in
(match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d - 1) t
| _ -> fail "mapply: can't apply (1)")
| None ->
let rt = norm_term [] rt in
match term_as_formula' rt with
| Implies p q ->
apply_lemma (`push1);
apply_squash_or_lem (d - 1) t
| _ ->
apply (`FStar.Squash.return_squash);
apply t)
| _ -> fail "mapply: can't apply (2)" | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_code_Fast_mul1 | val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code | val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code | let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
()))))))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 25,
"end_line": 46,
"start_col": 0,
"start_line": 24
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | va_dummy: Prims.unit -> Vale.X64.Decls.va_code | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Vale.X64.Decls.va_Block",
"Vale.X64.Decls.va_CCons",
"Vale.X64.InsMem.va_code_Mem64_lemma",
"Vale.X64.InsBasic.va_code_Mulx64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_opr_code_Mem64",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Decls.va_op_reg64_reg64",
"Vale.X64.Machine_s.rRsi",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.InsMem.va_code_Store64_buffer",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.InsBasic.va_code_Xor64",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rR10",
"Vale.X64.InsBasic.va_code_Add64Wrap",
"Vale.X64.Machine_s.rR13",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.InsBasic.va_code_Adcx64Wrap",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Machine_s.rR14",
"Vale.X64.Decls.va_CNil",
"Vale.X64.Decls.va_code"
] | [] | false | false | false | true | false | let va_code_Fast_mul1 () =
| (va_Block (va_CCons (va_code_Mem64_lemma ())
(va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR9)
(va_op_dst_opr64_reg64 rR8)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8)
0
Secret)
(va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_CCons (va_code_Mem64_lemma ())
(va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi)
8
Secret))
(va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10)
8
Secret)
(va_CCons (va_code_Mem64_lemma ())
(va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi)
16
Secret))
(va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx
)
(va_op_opr64_reg64 rR11))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx)
16
Secret)
(va_CCons (va_code_Mem64_lemma ())
(va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rRax)
(va_op_dst_opr64_reg64 rR14)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi)
24
Secret))
(va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR14)
(va_op_opr64_reg64 rR13))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14)
24
Secret)
(va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rRax)
(va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))
)) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_wp_Fast_mul1 | val va_wp_Fast_mul1 (dst_b inA_b: buffer64) (va_s0: va_state) (va_k: (va_state -> unit -> Type0))
: Type0 | val va_wp_Fast_mul1 (dst_b inA_b: buffer64) (va_s0: va_state) (va_k: (va_state -> unit -> Type0))
: Type0 | let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (()))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 62,
"end_line": 275,
"start_col": 0,
"start_line": 244
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Memory.buffer64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Prims.b2t",
"Vale.X64.Decls.va_get_ok",
"Vale.X64.CPU_Features_s.adx_enabled",
"Vale.X64.CPU_Features_s.bmi2_enabled",
"Prims.l_or",
"Vale.X64.Decls.buffers_disjoint",
"Prims.eq2",
"Vale.X64.Decls.validDstAddrs64",
"Vale.X64.Decls.va_get_mem_heaplet",
"Vale.X64.Decls.va_get_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Decls.va_get_mem_layout",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.Decls.validSrcAddrs64",
"Vale.X64.Machine_s.rRsi",
"Prims.nat",
"Vale.Curve25519.Fast_defs.pow2_four",
"Vale.Def.Words_s.nat64",
"Vale.X64.Decls.buffer64_read",
"Prims.l_Forall",
"Vale.X64.InsBasic.vale_heap",
"Vale.X64.Memory.nat64",
"Vale.X64.Flags.t",
"Prims.l_imp",
"Vale.X64.Decls.va_mul_nat",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Decls.modifies_buffer",
"Vale.Curve25519.Fast_defs.pow2_five",
"Vale.X64.Machine_s.rRax",
"Vale.X64.State.vale_state",
"Vale.X64.Decls.va_upd_flags",
"Vale.X64.Decls.va_upd_mem_heaplet",
"Vale.X64.Decls.va_upd_reg64",
"Vale.X64.Machine_s.rR14",
"Vale.X64.Machine_s.rR13",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_upd_mem"
] | [] | false | false | false | true | true | let va_wp_Fast_mul1 (dst_b inA_b: buffer64) (va_s0: va_state) (va_k: (va_state -> unit -> Type0))
: Type0 =
| (va_get_ok va_s0 /\
(let a0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in
let a1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in
let a2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0)
in
let a3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in
let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRdi va_s0)
dst_b
4
(va_get_mem_layout va_s0)
Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0)
inA_b
4
(va_get_mem_layout va_s0)
Secret) /\
(forall (va_x_mem: vale_heap) (va_x_rax: nat64) (va_x_r8: nat64) (va_x_r9: nat64)
(va_x_r10: nat64) (va_x_r11: nat64) (va_x_rbx: nat64) (va_x_r13: nat64) (va_x_r14: nat64)
(va_x_heap0: vale_heap) (va_x_efl: Vale.X64.Flags.t).
let va_sM =
va_upd_flags va_x_efl
(va_upd_mem_heaplet 0
va_x_heap0
(va_upd_reg64 rR14
va_x_r14
(va_upd_reg64 rR13
va_x_r13
(va_upd_reg64 rRbx
va_x_rbx
(va_upd_reg64 rR11
va_x_r11
(va_upd_reg64 rR10
va_x_r10
(va_upd_reg64 rR9
va_x_r9
(va_upd_reg64 rR8
va_x_r8
(va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))
))))))
in
va_get_ok va_sM /\
(let a0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in
let a1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in
let a2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0)
in
let a3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in
let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in
let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in
let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in
let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in
let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in
d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM)
dst_b
4
(va_get_mem_layout va_sM)
Secret /\
Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0)
(va_get_mem_heaplet 0 va_sM)) ==>
va_k va_sM (()))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_codegen_success_Fast_add1 | val va_codegen_success_Fast_add1 : va_dummy:unit -> Tot va_pbool | val va_codegen_success_Fast_add1 : va_dummy:unit -> Tot va_pbool | let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
())))))))))))))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 32,
"end_line": 374,
"start_col": 0,
"start_line": 343
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))))))))))))))))))))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Vale.X64.Decls.va_pbool_and",
"Vale.X64.InsMem.va_codegen_success_CreateHeaplets",
"Vale.X64.InsBasic.va_codegen_success_Comment",
"Vale.X64.InsBasic.va_codegen_success_Xor64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rRax",
"Vale.X64.InsBasic.va_codegen_success_Newline",
"Vale.X64.InsMem.va_codegen_success_Mem64_lemma",
"Vale.X64.InsBasic.va_codegen_success_Add64Wrap",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Decls.va_opr_code_Mem64",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Decls.va_op_reg64_reg64",
"Vale.X64.Machine_s.rRsi",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.InsMem.va_codegen_success_Store64_buffer",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.InsBasic.va_codegen_success_Adcx64Wrap",
"Vale.X64.InsMem.va_codegen_success_DestroyHeaplets",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | false | false | false | true | false | let va_codegen_success_Fast_add1 () =
| (va_pbool_and (va_codegen_success_CreateHeaplets ())
(va_pbool_and (va_codegen_success_Comment "Clear registers to propagate the carry bit")
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9)
(va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11)
(va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax)
(va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment "Begin addition chain")
(va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64
rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi)
0
Secret))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx)
0
Secret)
(va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64
rR8)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi)
8
Secret))
(va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8)
8
Secret)
(va_pbool_and (va_codegen_success_Mem64_lemma
())
(va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rR9)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi)
16
Secret))
(va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi
)
(va_op_reg_opr64_reg64 rR9
)
16
Secret)
(va_pbool_and (va_codegen_success_Mem64_lemma
())
(va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64
rR10)
(va_opr_code_Mem64
(va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64
rRsi)
24
Secret))
(va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64
rRdi)
(va_op_reg_opr64_reg64
rR10)
24
Secret)
(va_pbool_and (va_codegen_success_Newline
())
(va_pbool_and
(va_codegen_success_Comment
"Return the carry bit in a register"
)
(va_pbool_and
(va_codegen_success_Adcx64Wrap
(
va_op_dst_opr64_reg64
rRax
)
(
va_op_opr64_reg64
rR11
)
)
(va_pbool_and
(
va_codegen_success_DestroyHeaplets
()
)
(
va_ttrue
()
)
))
))))))))))))
))))))))))) | false |
Hacl.Spec.Bignum.Karatsuba.fst | Hacl.Spec.Bignum.Karatsuba.bn_karatsuba_res_lemma | val bn_karatsuba_res_lemma:
#t:limb_t
-> #aLen:size_pos{2 * aLen <= max_size_t}
-> r01:lbignum t aLen
-> r23:lbignum t aLen
-> c5:limb t{v c5 <= 1}
-> t45:lbignum t aLen ->
Lemma
(let c, res = bn_karatsuba_res r01 r23 c5 t45 in
bn_v res + v c * pow2 (bits t * (aLen + aLen)) ==
bn_v r23 * pow2 (bits t * aLen) + (v c5 * pow2 (bits t * aLen) + bn_v t45) * pow2 (aLen / 2 * bits t) + bn_v r01) | val bn_karatsuba_res_lemma:
#t:limb_t
-> #aLen:size_pos{2 * aLen <= max_size_t}
-> r01:lbignum t aLen
-> r23:lbignum t aLen
-> c5:limb t{v c5 <= 1}
-> t45:lbignum t aLen ->
Lemma
(let c, res = bn_karatsuba_res r01 r23 c5 t45 in
bn_v res + v c * pow2 (bits t * (aLen + aLen)) ==
bn_v r23 * pow2 (bits t * aLen) + (v c5 * pow2 (bits t * aLen) + bn_v t45) * pow2 (aLen / 2 * bits t) + bn_v r01) | let bn_karatsuba_res_lemma #t #aLen r01 r23 c5 t45 =
let pbits = bits t in
let aLen2 = aLen / 2 in
let aLen3 = aLen + aLen2 in
let aLen4 = aLen + aLen in
let res0 = concat r01 r23 in
let c6, res1 = bn_lshift_add_early_stop res0 t45 aLen2 in
let c7 = c5 +. c6 in
let c8, res2 = bn_lshift_add res1 c7 aLen3 in
calc (==) {
bn_v res2 + v c8 * pow2 (pbits * aLen4);
(==) { bn_lshift_add_lemma res1 c7 aLen3 }
bn_v res1 + v c7 * pow2 (pbits * aLen3);
(==) { Math.Lemmas.small_mod (v c5 + v c6) (pow2 pbits) }
bn_v res1 + (v c5 + v c6) * pow2 (pbits * aLen3);
(==) { bn_lshift_add_early_stop_lemma res0 t45 aLen2 }
bn_v res0 + bn_v t45 * pow2 (pbits * aLen2) - v c6 * pow2 (pbits * aLen3) + (v c5 + v c6) * pow2 (pbits * aLen3);
(==) { Math.Lemmas.distributivity_add_left (v c5) (v c6) (pow2 (pbits * aLen3)) }
bn_v res0 + bn_v t45 * pow2 (pbits * aLen2) + v c5 * pow2 (pbits * aLen3);
(==) { Math.Lemmas.pow2_plus (pbits * aLen) (pbits * aLen2) }
bn_v res0 + bn_v t45 * pow2 (pbits * aLen2) + v c5 * (pow2 (pbits * aLen) * pow2 (pbits * aLen2));
(==) { Math.Lemmas.paren_mul_right (v c5) (pow2 (pbits * aLen)) (pow2 (pbits * aLen2));
Math.Lemmas.distributivity_add_left (bn_v t45) (v c5 * pow2 (pbits * aLen)) (pow2 (pbits * aLen2)) }
bn_v res0 + (bn_v t45 + v c5 * pow2 (pbits * aLen)) * pow2 (pbits * aLen2);
(==) { bn_concat_lemma r01 r23 }
bn_v r23 * pow2 (pbits * aLen) + (v c5 * pow2 (pbits * aLen) + bn_v t45) * pow2 (pbits * aLen2) + bn_v r01;
} | {
"file_name": "code/bignum/Hacl.Spec.Bignum.Karatsuba.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 5,
"end_line": 407,
"start_col": 0,
"start_line": 378
} | module Hacl.Spec.Bignum.Karatsuba
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.LoopCombinators
open Hacl.Spec.Bignum.Definitions
open Hacl.Spec.Bignum.Base
open Hacl.Spec.Bignum.Lib
open Hacl.Spec.Lib
open Hacl.Spec.Bignum.Addition
open Hacl.Spec.Bignum.Multiplication
open Hacl.Spec.Bignum.Squaring
module K = Hacl.Spec.Karatsuba.Lemmas
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let bn_mul_threshold = 32
(* this carry means nothing but the sign of the result *)
val bn_sign_abs:
#t:limb_t
-> #aLen:size_nat
-> a:lbignum t aLen
-> b:lbignum t aLen ->
tuple2 (carry t) (lbignum t aLen)
let bn_sign_abs #t #aLen a b =
let c0, t0 = bn_sub a b in
let c1, t1 = bn_sub b a in
let res = map2 (mask_select (uint #t 0 -. c0)) t1 t0 in
c0, res
val bn_sign_abs_lemma:
#t:limb_t
-> #aLen:size_nat
-> a:lbignum t aLen
-> b:lbignum t aLen ->
Lemma (let c, res = bn_sign_abs a b in
bn_v res == K.abs (bn_v a) (bn_v b) /\
v c == (if bn_v a < bn_v b then 1 else 0))
let bn_sign_abs_lemma #t #aLen a b =
let s, r = K.sign_abs (bn_v a) (bn_v b) in
let c0, t0 = bn_sub a b in
bn_sub_lemma a b;
assert (bn_v t0 - v c0 * pow2 (bits t * aLen) == bn_v a - bn_v b);
let c1, t1 = bn_sub b a in
bn_sub_lemma b a;
assert (bn_v t1 - v c1 * pow2 (bits t * aLen) == bn_v b - bn_v a);
let mask = uint #t 0 -. c0 in
assert (v mask == (if v c0 = 0 then 0 else v (ones t SEC)));
let res = map2 (mask_select mask) t1 t0 in
lseq_mask_select_lemma t1 t0 mask;
assert (bn_v res == (if v mask = 0 then bn_v t0 else bn_v t1));
bn_eval_bound a aLen;
bn_eval_bound b aLen;
bn_eval_bound t0 aLen;
bn_eval_bound t1 aLen
// if bn_v a < bn_v b then begin
// assert (v mask = v (ones U64 SEC));
// assert (bn_v res == bn_v b - bn_v a);
// assert (bn_v res == r /\ v c0 = 1) end
// else begin
// assert (v mask = 0);
// assert (bn_v res == bn_v a - bn_v b);
// assert (bn_v res == r /\ v c0 = 0) end;
// assert (bn_v res == r /\ v c0 == (if bn_v a < bn_v b then 1 else 0))
val bn_middle_karatsuba:
#t:limb_t
-> #aLen:size_nat
-> c0:carry t
-> c1:carry t
-> c2:carry t
-> t01:lbignum t aLen
-> t23:lbignum t aLen ->
limb t & lbignum t aLen
let bn_middle_karatsuba #t #aLen c0 c1 c2 t01 t23 =
let c_sign = c0 ^. c1 in
let c3, t45 = bn_sub t01 t23 in let c3 = c2 -. c3 in
let c4, t67 = bn_add t01 t23 in let c4 = c2 +. c4 in
let mask = uint #t 0 -. c_sign in
let t45 = map2 (mask_select mask) t67 t45 in
let c5 = mask_select mask c4 c3 in
c5, t45
val sign_lemma: #t:limb_t -> c0:carry t -> c1:carry t ->
Lemma (v (c0 ^. c1) == (if v c0 = v c1 then 0 else 1))
let sign_lemma #t c0 c1 =
logxor_spec c0 c1;
match t with
| U32 ->
assert_norm (UInt32.logxor 0ul 0ul == 0ul);
assert_norm (UInt32.logxor 0ul 1ul == 1ul);
assert_norm (UInt32.logxor 1ul 0ul == 1ul);
assert_norm (UInt32.logxor 1ul 1ul == 0ul)
| U64 ->
assert_norm (UInt64.logxor 0uL 0uL == 0uL);
assert_norm (UInt64.logxor 0uL 1uL == 1uL);
assert_norm (UInt64.logxor 1uL 0uL == 1uL);
assert_norm (UInt64.logxor 1uL 1uL == 0uL)
val bn_middle_karatsuba_lemma:
#t:limb_t
-> #aLen:size_nat
-> c0:carry t
-> c1:carry t
-> c2:carry t
-> t01:lbignum t aLen
-> t23:lbignum t aLen ->
Lemma (let (c, res) = bn_middle_karatsuba c0 c1 c2 t01 t23 in
let c3, t45 = bn_sub t01 t23 in let c3' = c2 -. c3 in
let c4, t67 = bn_add t01 t23 in let c4' = c2 +. c4 in
if v c0 = v c1 then
v c == v c3' /\ bn_v res == bn_v t45
else
v c == v c4' /\ bn_v res == bn_v t67)
let bn_middle_karatsuba_lemma #t #aLen c0 c1 c2 t01 t23 =
let lp = bn_v t01 + v c2 * pow2 (bits t * aLen) - bn_v t23 in
let rp = bn_v t01 + v c2 * pow2 (bits t * aLen) + bn_v t23 in
let c_sign = c0 ^. c1 in
sign_lemma c0 c1;
assert (v c_sign == (if v c0 = v c1 then 0 else 1));
let c3, t45 = bn_sub t01 t23 in let c3' = c2 -. c3 in
let c4, t67 = bn_add t01 t23 in let c4' = c2 +. c4 in
let mask = uint #t 0 -. c_sign in
let t45' = map2 (mask_select mask) t67 t45 in
lseq_mask_select_lemma t67 t45 mask;
//assert (bn_v t45' == (if v mask = 0 then bn_v t45 else bn_v t67));
let c5 = mask_select mask c4' c3' in
mask_select_lemma mask c4' c3'
//assert (v c5 == (if v mask = 0 then v c3' else v c4'));
val bn_middle_karatsuba_eval_aux:
#t:limb_t
-> #aLen:size_nat
-> a0:lbignum t (aLen / 2)
-> a1:lbignum t (aLen / 2)
-> b0:lbignum t (aLen / 2)
-> b1:lbignum t (aLen / 2)
-> res:lbignum t aLen
-> c2:carry t
-> c3:carry t -> Lemma
(requires
bn_v res + (v c2 - v c3) * pow2 (bits t * aLen) ==
bn_v a0 * bn_v b1 + bn_v a1 * bn_v b0)
(ensures 0 <= v c2 - v c3 /\ v c2 - v c3 <= 1)
let bn_middle_karatsuba_eval_aux #t #aLen a0 a1 b0 b1 res c2 c3 =
bn_eval_bound res aLen
val bn_middle_karatsuba_eval:
#t:limb_t
-> #aLen:size_nat
-> a0:lbignum t (aLen / 2)
-> a1:lbignum t (aLen / 2)
-> b0:lbignum t (aLen / 2)
-> b1:lbignum t (aLen / 2)
-> c2:carry t
-> t01:lbignum t aLen
-> t23:lbignum t aLen ->
Lemma
(requires
(let t0 = K.abs (bn_v a0) (bn_v a1) in
let t1 = K.abs (bn_v b0) (bn_v b1) in
bn_v t01 + v c2 * pow2 (bits t * aLen) == bn_v a0 * bn_v b0 + bn_v a1 * bn_v b1 /\
bn_v t23 == t0 * t1))
(ensures
(let c0, t0 = bn_sign_abs a0 a1 in
let c1, t1 = bn_sign_abs b0 b1 in
let c, res = bn_middle_karatsuba c0 c1 c2 t01 t23 in
bn_v res + v c * pow2 (bits t * aLen) == bn_v a0 * bn_v b1 + bn_v a1 * bn_v b0))
let bn_middle_karatsuba_eval #t #aLen a0 a1 b0 b1 c2 t01 t23 =
let pbits = bits t in
let c0, t0 = bn_sign_abs a0 a1 in
bn_sign_abs_lemma a0 a1;
assert (bn_v t0 == K.abs (bn_v a0) (bn_v a1));
assert (v c0 == (if bn_v a0 < bn_v a1 then 1 else 0));
let c1, t1 = bn_sign_abs b0 b1 in
bn_sign_abs_lemma b0 b1;
assert (bn_v t1 == K.abs (bn_v b0) (bn_v b1));
assert (v c1 == (if bn_v b0 < bn_v b1 then 1 else 0));
let c, res = bn_middle_karatsuba c0 c1 c2 t01 t23 in
bn_middle_karatsuba_lemma c0 c1 c2 t01 t23;
let c3, t45 = bn_sub t01 t23 in let c3' = c2 -. c3 in
let c4, t67 = bn_add t01 t23 in let c4' = c2 +. c4 in
if v c0 = v c1 then begin
assert (bn_v a0 * bn_v b0 + bn_v a1 * bn_v b1 - bn_v t0 * bn_v t1 == bn_v a0 * bn_v b1 + bn_v a1 * bn_v b0);
assert (v c2 * pow2 (pbits * aLen) + bn_v t01 - bn_v t23 == bn_v a0 * bn_v b1 + bn_v a1 * bn_v b0);
assert (v c == v c3' /\ bn_v res == bn_v t45);
//assert (v c = (v c2 - v c3) % pow2 pb);
bn_sub_lemma t01 t23;
assert (bn_v res - v c3 * pow2 (pbits * aLen) == bn_v t01 - bn_v t23);
Math.Lemmas.distributivity_sub_left (v c2) (v c3) (pow2 (pbits * aLen));
assert (bn_v res + (v c2 - v c3) * pow2 (pbits * aLen) == v c2 * pow2 (pbits * aLen) + bn_v t01 - bn_v t23);
bn_middle_karatsuba_eval_aux a0 a1 b0 b1 res c2 c3;
Math.Lemmas.small_mod (v c2 - v c3) (pow2 pbits);
assert (bn_v res + v c * pow2 (pbits * aLen) == v c2 * pow2 (pbits * aLen) + bn_v t01 - bn_v t23);
() end
else begin
assert (bn_v a0 * bn_v b0 + bn_v a1 * bn_v b1 + bn_v t0 * bn_v t1 == bn_v a0 * bn_v b1 + bn_v a1 * bn_v b0);
assert (v c2 * pow2 (pbits * aLen) + bn_v t01 + bn_v t23 == bn_v a0 * bn_v b1 + bn_v a1 * bn_v b0);
assert (v c == v c4' /\ bn_v res == bn_v t67);
//assert (v c = v c2 + v c4);
bn_add_lemma t01 t23;
assert (bn_v res + v c4 * pow2 (pbits * aLen) == bn_v t01 + bn_v t23);
Math.Lemmas.distributivity_add_left (v c2) (v c4) (pow2 (pbits * aLen));
Math.Lemmas.small_mod (v c2 + v c4) (pow2 pbits);
assert (bn_v res + v c * pow2 (pbits * aLen) == v c2 * pow2 (pbits * aLen) + bn_v t01 + bn_v t23);
() end
val bn_lshift_add:
#t:limb_t
-> #aLen:size_nat
-> a:lbignum t aLen
-> b1:limb t
-> i:nat{i + 1 <= aLen} ->
tuple2 (carry t) (lbignum t aLen)
let bn_lshift_add #t #aLen a b1 i =
let r = sub a i (aLen - i) in
let c, r' = bn_add1 r b1 in
let a' = update_sub a i (aLen - i) r' in
c, a'
val bn_lshift_add_lemma:
#t:limb_t
-> #aLen:size_nat
-> a:lbignum t aLen
-> b1:limb t
-> i:nat{i + 1 <= aLen} ->
Lemma (let c, res = bn_lshift_add a b1 i in
bn_v res + v c * pow2 (bits t * aLen) == bn_v a + v b1 * pow2 (bits t * i))
let bn_lshift_add_lemma #t #aLen a b1 i =
let pbits = bits t in
let r = sub a i (aLen - i) in
let c, r' = bn_add1 r b1 in
let a' = update_sub a i (aLen - i) r' in
let p = pow2 (pbits * aLen) in
calc (==) {
bn_v a' + v c * p;
(==) { bn_update_sub_eval a r' i }
bn_v a - bn_v r * pow2 (pbits * i) + bn_v r' * pow2 (pbits * i) + v c * p;
(==) { bn_add1_lemma r b1 }
bn_v a - bn_v r * pow2 (pbits * i) + (bn_v r + v b1 - v c * pow2 (pbits * (aLen - i))) * pow2 (pbits * i) + v c * p;
(==) { Math.Lemmas.distributivity_add_left (bn_v r) (v b1 - v c * pow2 (pbits * (aLen - i))) (pow2 (pbits * i)) }
bn_v a + (v b1 - v c * pow2 (pbits * (aLen - i))) * pow2 (pbits * i) + v c * p;
(==) { Math.Lemmas.distributivity_sub_left (v b1) (v c * pow2 (pbits * (aLen - i))) (pow2 (pbits * i)) }
bn_v a + v b1 * pow2 (pbits * i) - (v c * pow2 (pbits * (aLen - i))) * pow2 (pbits * i) + v c * p;
(==) { Math.Lemmas.paren_mul_right (v c) (pow2 (pbits * (aLen - i))) (pow2 (pbits * i));
Math.Lemmas.pow2_plus (pbits * (aLen - i)) (pbits * i) }
bn_v a + v b1 * pow2 (pbits * i);
}
val bn_lshift_add_early_stop:
#t:limb_t
-> #aLen:size_nat
-> #bLen:size_nat
-> a:lbignum t aLen
-> b:lbignum t bLen
-> i:nat{i + bLen <= aLen} ->
tuple2 (carry t) (lbignum t aLen)
let bn_lshift_add_early_stop #t #aLen #bLen a b i =
let r = sub a i bLen in
let c, r' = bn_add r b in
let a' = update_sub a i bLen r' in
c, a'
val bn_lshift_add_early_stop_lemma:
#t:limb_t
-> #aLen:size_nat
-> #bLen:size_nat
-> a:lbignum t aLen
-> b:lbignum t bLen
-> i:nat{i + bLen <= aLen} ->
Lemma (let c, res = bn_lshift_add_early_stop a b i in
bn_v res + v c * pow2 (bits t * (i + bLen)) == bn_v a + bn_v b * pow2 (bits t * i))
let bn_lshift_add_early_stop_lemma #t #aLen #bLen a b i =
let pbits = bits t in
let r = sub a i bLen in
let c, r' = bn_add r b in
let a' = update_sub a i bLen r' in
let p = pow2 (pbits * (i + bLen)) in
calc (==) {
bn_v a' + v c * p;
(==) { bn_update_sub_eval a r' i }
bn_v a - bn_v r * pow2 (pbits * i) + bn_v r' * pow2 (pbits * i) + v c * p;
(==) { bn_add_lemma r b }
bn_v a - bn_v r * pow2 (pbits * i) + (bn_v r + bn_v b - v c * pow2 (pbits * bLen)) * pow2 (pbits * i) + v c * p;
(==) { Math.Lemmas.distributivity_add_left (bn_v r) (bn_v b - v c * pow2 (pbits * bLen)) (pow2 (pbits * i)) }
bn_v a + (bn_v b - v c * pow2 (pbits * bLen)) * pow2 (pbits * i) + v c * p;
(==) { Math.Lemmas.distributivity_sub_left (bn_v b) (v c * pow2 (pbits * bLen)) (pow2 (pbits * i)) }
bn_v a + bn_v b * pow2 (pbits * i) - (v c * pow2 (pbits * bLen)) * pow2 (pbits * i) + v c * p;
(==) { Math.Lemmas.paren_mul_right (v c) (pow2 (pbits * bLen)) (pow2 (pbits * i));
Math.Lemmas.pow2_plus (pbits * bLen) (pbits * i) }
bn_v a + bn_v b * pow2 (pbits * i);
}
val bn_karatsuba_res:
#t:limb_t
-> #aLen:size_pos{2 * aLen <= max_size_t}
-> r01:lbignum t aLen
-> r23:lbignum t aLen
-> c5:limb t
-> t45:lbignum t aLen ->
tuple2 (carry t) (lbignum t (aLen + aLen))
let bn_karatsuba_res #t #aLen r01 r23 c5 t45 =
let aLen2 = aLen / 2 in
let res = concat r01 r23 in
let c6, res = bn_lshift_add_early_stop res t45 aLen2 in
// let r12 = sub res aLen2 aLen in
// let c6, r12 = bn_add r12 t45 in
// let res = update_sub res aLen2 aLen r12 in
let c7 = c5 +. c6 in
let c8, res = bn_lshift_add res c7 (aLen + aLen2) in
// let r3 = sub res (aLen + aLen2) aLen2 in
// let _, r3 = bn_add r3 (create 1 c7) in
// let res = update_sub res (aLen + aLen2) aLen2 r3 in
c8, res
val bn_karatsuba_res_lemma:
#t:limb_t
-> #aLen:size_pos{2 * aLen <= max_size_t}
-> r01:lbignum t aLen
-> r23:lbignum t aLen
-> c5:limb t{v c5 <= 1}
-> t45:lbignum t aLen ->
Lemma
(let c, res = bn_karatsuba_res r01 r23 c5 t45 in
bn_v res + v c * pow2 (bits t * (aLen + aLen)) ==
bn_v r23 * pow2 (bits t * aLen) + (v c5 * pow2 (bits t * aLen) + bn_v t45) * pow2 (aLen / 2 * bits t) + bn_v r01) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Lib.fst.checked",
"Hacl.Spec.Karatsuba.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Squaring.fst.checked",
"Hacl.Spec.Bignum.Multiplication.fst.checked",
"Hacl.Spec.Bignum.Lib.fst.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Spec.Bignum.Base.fst.checked",
"Hacl.Spec.Bignum.Addition.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Bignum.Karatsuba.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Karatsuba.Lemmas",
"short_module": "K"
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Squaring",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Multiplication",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Addition",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
r01: Hacl.Spec.Bignum.Definitions.lbignum t aLen ->
r23: Hacl.Spec.Bignum.Definitions.lbignum t aLen ->
c5: Hacl.Spec.Bignum.Definitions.limb t {Lib.IntTypes.v c5 <= 1} ->
t45: Hacl.Spec.Bignum.Definitions.lbignum t aLen
-> FStar.Pervasives.Lemma
(ensures
(let _ = Hacl.Spec.Bignum.Karatsuba.bn_karatsuba_res r01 r23 c5 t45 in
(let FStar.Pervasives.Native.Mktuple2 #_ #_ c res = _ in
Hacl.Spec.Bignum.Definitions.bn_v res +
Lib.IntTypes.v c * Prims.pow2 (Lib.IntTypes.bits t * (aLen + aLen)) ==
Hacl.Spec.Bignum.Definitions.bn_v r23 * Prims.pow2 (Lib.IntTypes.bits t * aLen) +
(Lib.IntTypes.v c5 * Prims.pow2 (Lib.IntTypes.bits t * aLen) +
Hacl.Spec.Bignum.Definitions.bn_v t45) *
Prims.pow2 ((aLen / 2) * Lib.IntTypes.bits t) +
Hacl.Spec.Bignum.Definitions.bn_v r01)
<:
Type0)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Hacl.Spec.Bignum.Definitions.limb_t",
"Lib.IntTypes.size_pos",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.Mul.op_Star",
"Lib.IntTypes.max_size_t",
"Hacl.Spec.Bignum.Definitions.lbignum",
"Hacl.Spec.Bignum.Definitions.limb",
"Lib.IntTypes.v",
"Lib.IntTypes.SEC",
"Hacl.Spec.Bignum.Base.carry",
"Prims.op_Addition",
"FStar.Calc.calc_finish",
"Prims.int",
"Prims.eq2",
"Hacl.Spec.Bignum.Definitions.bn_v",
"Prims.pow2",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"Prims.op_Subtraction",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"Hacl.Spec.Bignum.Karatsuba.bn_lshift_add_lemma",
"Prims.squash",
"FStar.Math.Lemmas.small_mod",
"Hacl.Spec.Bignum.Karatsuba.bn_lshift_add_early_stop_lemma",
"FStar.Math.Lemmas.distributivity_add_left",
"FStar.Math.Lemmas.pow2_plus",
"FStar.Math.Lemmas.paren_mul_right",
"Hacl.Spec.Bignum.Definitions.bn_concat_lemma",
"FStar.Pervasives.Native.tuple2",
"Hacl.Spec.Bignum.Karatsuba.bn_lshift_add",
"Lib.IntTypes.int_t",
"Lib.IntTypes.op_Plus_Dot",
"Hacl.Spec.Bignum.Karatsuba.bn_lshift_add_early_stop",
"Lib.Sequence.lseq",
"FStar.Seq.Base.seq",
"Lib.Sequence.to_seq",
"FStar.Seq.Base.append",
"Lib.Sequence.concat",
"Prims.op_Division",
"Lib.IntTypes.bits"
] | [] | false | false | true | false | false | let bn_karatsuba_res_lemma #t #aLen r01 r23 c5 t45 =
| let pbits = bits t in
let aLen2 = aLen / 2 in
let aLen3 = aLen + aLen2 in
let aLen4 = aLen + aLen in
let res0 = concat r01 r23 in
let c6, res1 = bn_lshift_add_early_stop res0 t45 aLen2 in
let c7 = c5 +. c6 in
let c8, res2 = bn_lshift_add res1 c7 aLen3 in
calc ( == ) {
bn_v res2 + v c8 * pow2 (pbits * aLen4);
( == ) { bn_lshift_add_lemma res1 c7 aLen3 }
bn_v res1 + v c7 * pow2 (pbits * aLen3);
( == ) { Math.Lemmas.small_mod (v c5 + v c6) (pow2 pbits) }
bn_v res1 + (v c5 + v c6) * pow2 (pbits * aLen3);
( == ) { bn_lshift_add_early_stop_lemma res0 t45 aLen2 }
bn_v res0 + bn_v t45 * pow2 (pbits * aLen2) - v c6 * pow2 (pbits * aLen3) +
(v c5 + v c6) * pow2 (pbits * aLen3);
( == ) { Math.Lemmas.distributivity_add_left (v c5) (v c6) (pow2 (pbits * aLen3)) }
bn_v res0 + bn_v t45 * pow2 (pbits * aLen2) + v c5 * pow2 (pbits * aLen3);
( == ) { Math.Lemmas.pow2_plus (pbits * aLen) (pbits * aLen2) }
bn_v res0 + bn_v t45 * pow2 (pbits * aLen2) + v c5 * (pow2 (pbits * aLen) * pow2 (pbits * aLen2));
( == ) { (Math.Lemmas.paren_mul_right (v c5) (pow2 (pbits * aLen)) (pow2 (pbits * aLen2));
Math.Lemmas.distributivity_add_left (bn_v t45)
(v c5 * pow2 (pbits * aLen))
(pow2 (pbits * aLen2))) }
bn_v res0 + (bn_v t45 + v c5 * pow2 (pbits * aLen)) * pow2 (pbits * aLen2);
( == ) { bn_concat_lemma r01 r23 }
bn_v r23 * pow2 (pbits * aLen) + (v c5 * pow2 (pbits * aLen) + bn_v t45) * pow2 (pbits * aLen2) +
bn_v r01;
} | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_codegen_success_Fast_mul1 | val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool | val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool | let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
())))))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 24,
"end_line": 76,
"start_col": 0,
"start_line": 50
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Vale.X64.Decls.va_pbool_and",
"Vale.X64.InsMem.va_codegen_success_Mem64_lemma",
"Vale.X64.InsBasic.va_codegen_success_Mulx64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_opr_code_Mem64",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Decls.va_op_reg64_reg64",
"Vale.X64.Machine_s.rRsi",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.InsMem.va_codegen_success_Store64_buffer",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.InsBasic.va_codegen_success_Xor64",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rR10",
"Vale.X64.InsBasic.va_codegen_success_Add64Wrap",
"Vale.X64.Machine_s.rR13",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.InsBasic.va_codegen_success_Adcx64Wrap",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Machine_s.rR14",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | false | false | false | true | false | let va_codegen_success_Fast_mul1 () =
| (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR9)
(va_op_dst_opr64_reg64 rR8)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8)
0
Secret)
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi)
8
Secret))
(va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10)
8
Secret)
(va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13
)
(va_op_dst_opr64_reg64 rRbx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi)
16
Secret))
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64
rRbx)
(va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx)
16
Secret)
(va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64
rRax)
(va_op_dst_opr64_reg64 rR14)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi)
24
Secret))
(va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14)
24
Secret)
(va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax)
(va_op_opr64_reg64 rR8))
(va_ttrue ())))))))))))))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_code_Fast_add1_stdcall | val va_code_Fast_add1_stdcall : win:bool -> Tot va_code | val va_code_Fast_add1_stdcall : win:bool -> Tot va_code | let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ())))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 90,
"end_line": 523,
"start_col": 0,
"start_line": 516
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600" | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | win: Prims.bool -> Vale.X64.Decls.va_code | Prims.Tot | [
"total"
] | [] | [
"Prims.bool",
"Vale.X64.Decls.va_Block",
"Vale.X64.Decls.va_CCons",
"Vale.X64.InsStack.va_code_Push_Secret",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rRsi",
"Vale.X64.InsBasic.va_code_Mov64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_CNil",
"Vale.X64.Decls.va_code",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_add1",
"Vale.X64.InsStack.va_code_Pop_Secret"
] | [] | false | false | false | true | false | let va_code_Fast_add1_stdcall win =
| (va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi))
(va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi))
(va_CCons (if win
then
va_Block (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi)
(va_op_opr64_reg64 rRcx))
(va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi)
(va_op_opr64_reg64 rRdx))
(va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx)
(va_op_opr64_reg64 rR8))
(va_CNil ()))))
else va_Block (va_CNil ()))
(va_CCons (va_code_Fast_add1 ())
(va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi))
(va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ())))))
))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_codegen_success_Fast_add1_stdcall | val va_codegen_success_Fast_add1_stdcall : win:bool -> Tot va_pbool | val va_codegen_success_Fast_add1_stdcall : win:bool -> Tot va_pbool | let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ()))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 84,
"end_line": 534,
"start_col": 0,
"start_line": 526
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ())))))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | win: Prims.bool -> Vale.X64.Decls.va_pbool | Prims.Tot | [
"total"
] | [] | [
"Prims.bool",
"Vale.X64.Decls.va_pbool_and",
"Vale.X64.InsStack.va_codegen_success_Push_Secret",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rRsi",
"Vale.X64.InsBasic.va_codegen_success_Mov64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool",
"Vale.Curve25519.X64.FastUtil.va_codegen_success_Fast_add1",
"Vale.X64.InsStack.va_codegen_success_Pop_Secret"
] | [] | false | false | false | true | false | let va_codegen_success_Fast_add1_stdcall win =
| (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi))
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi))
(va_pbool_and (if win
then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi)
(va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi)
(va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx)
(va_op_opr64_reg64 rR8))
(va_ttrue ())))
else va_ttrue ())
(va_pbool_and (va_codegen_success_Fast_add1 ())
(va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi))
(va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi))
(va_ttrue ()))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_codegen_success_Fast_sub1 | val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool | val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool | let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ()))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 86,
"end_line": 716,
"start_col": 0,
"start_line": 695
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 1200,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Vale.X64.Decls.va_pbool_and",
"Vale.X64.InsBasic.va_codegen_success_Xor64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.InsMem.va_codegen_success_Load64_buffer",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRsi",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.InsBasic.va_codegen_success_Sub64Wrap",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.InsMem.va_codegen_success_Store64_buffer",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rR9",
"Vale.X64.InsBasic.va_codegen_success_Sbb64",
"Vale.X64.Decls.va_const_opr64",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR11",
"Vale.X64.InsBasic.va_codegen_success_Adc64Wrap",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | false | false | false | true | false | let va_codegen_success_Fast_sub1 () =
| (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi)
0
Secret)
(va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8)
0
Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi)
8
Secret)
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0
)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9)
8
Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi)
16
Secret)
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10)
16
Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi)
24
Secret)
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64
rR11)
(va_const_opr64 0))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11)
24
Secret)
(va_pbool_and (va_codegen_success_Adc64Wrap (va_op_dst_opr64_reg64
rRax)
(va_op_opr64_reg64 rRax))
(va_ttrue ()))))))))))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_code_Fast_sub1 | val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code | val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code | let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
())))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 22,
"end_line": 691,
"start_col": 0,
"start_line": 672
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 1200,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | va_dummy: Prims.unit -> Vale.X64.Decls.va_code | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Vale.X64.Decls.va_Block",
"Vale.X64.Decls.va_CCons",
"Vale.X64.InsBasic.va_code_Xor64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.InsMem.va_code_Load64_buffer",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRsi",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.InsBasic.va_code_Sub64Wrap",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.InsMem.va_code_Store64_buffer",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rR9",
"Vale.X64.InsBasic.va_code_Sbb64",
"Vale.X64.Decls.va_const_opr64",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR11",
"Vale.X64.InsBasic.va_code_Adc64Wrap",
"Vale.X64.Decls.va_CNil",
"Vale.X64.Decls.va_code"
] | [] | false | false | false | true | false | let va_code_Fast_sub1 () =
| (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi)
0
Secret)
(va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8)
0
Secret)
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi)
8
Secret)
(va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9)
8
Secret)
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi)
16
Secret)
(va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10)
16
Secret)
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi)
24
Secret)
(va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11
)
(va_const_opr64 0))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11)
24
Secret)
(va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64
rRax)
(va_op_opr64_reg64 rRax))
(va_CNil ())))))))))))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_code_Fast_add1 | val va_code_Fast_add1 : va_dummy:unit -> Tot va_code | val va_code_Fast_add1 : va_dummy:unit -> Tot va_code | let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))))))))))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 81,
"end_line": 340,
"start_col": 0,
"start_line": 313
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600" | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | va_dummy: Prims.unit -> Vale.X64.Decls.va_code | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Vale.X64.Decls.va_Block",
"Vale.X64.Decls.va_CCons",
"Vale.X64.InsMem.va_code_CreateHeaplets",
"Vale.X64.InsBasic.va_code_Comment",
"Vale.X64.InsBasic.va_code_Xor64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rRax",
"Vale.X64.InsBasic.va_code_Newline",
"Vale.X64.InsMem.va_code_Mem64_lemma",
"Vale.X64.InsBasic.va_code_Add64Wrap",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Decls.va_opr_code_Mem64",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Decls.va_op_reg64_reg64",
"Vale.X64.Machine_s.rRsi",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.InsMem.va_code_Store64_buffer",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.InsBasic.va_code_Adcx64Wrap",
"Vale.X64.InsMem.va_code_DestroyHeaplets",
"Vale.X64.Decls.va_CNil",
"Vale.X64.Decls.va_code"
] | [] | false | false | false | true | false | let va_code_Fast_add1 () =
| (va_Block (va_CCons (va_code_CreateHeaplets ())
(va_CCons (va_code_Comment "Clear registers to propagate the carry bit")
(va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR11)
(va_op_opr64_reg64 rR11))
(va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax)
(va_op_opr64_reg64 rRax))
(va_CCons (va_code_Newline ())
(va_CCons (va_code_Comment "Begin addition chain")
(va_CCons (va_code_Mem64_lemma ())
(va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx
)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi)
0
Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx)
0
Secret)
(va_CCons (va_code_Mem64_lemma ())
(va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR8)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi)
8
Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8)
8
Secret)
(va_CCons (va_code_Mem64_lemma ())
(va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi
)
16
Secret))
(va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64
rRdi)
(va_op_reg_opr64_reg64
rR9)
16
Secret)
(va_CCons (va_code_Mem64_lemma
())
(va_CCons (va_code_Adcx64Wrap
(va_op_dst_opr64_reg64
rR10)
(va_opr_code_Mem64
(va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64
rRsi
)
24
Secret))
(va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64
rRdi
)
(va_op_reg_opr64_reg64
rR10
)
24
Secret)
(va_CCons (va_code_Newline
())
(va_CCons
(va_code_Comment
"Return the carry bit in a register"
)
(va_CCons
(
va_code_Adcx64Wrap
(
va_op_dst_opr64_reg64
rRax
)
(
va_op_opr64_reg64
rR11
)
)
(
va_CCons
(
va_code_DestroyHeaplets
()
)
(
va_CNil
()
)
)
))
))))))))))))
))))))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_wp_Fast_sub1 | val va_wp_Fast_sub1 (dst_b inA_b: buffer64) (va_s0: va_state) (va_k: (va_state -> unit -> Type0))
: Type0 | val va_wp_Fast_sub1 (dst_b inA_b: buffer64) (va_s0: va_state) (va_k: (va_state -> unit -> Type0))
: Type0 | let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (()))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 84,
"end_line": 875,
"start_col": 0,
"start_line": 845
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 1200,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Memory.buffer64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Prims.b2t",
"Vale.X64.Decls.va_get_ok",
"Prims.l_or",
"Vale.X64.Decls.buffers_disjoint",
"Prims.eq2",
"Vale.X64.Decls.validDstAddrs64",
"Vale.X64.Decls.va_get_mem_heaplet",
"Vale.X64.Decls.va_get_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Decls.va_get_mem_layout",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.Decls.validSrcAddrs64",
"Vale.X64.Machine_s.rRsi",
"Prims.nat",
"Vale.Curve25519.Fast_defs.pow2_four",
"Vale.Def.Words_s.nat64",
"Vale.X64.Decls.buffer64_read",
"Prims.l_Forall",
"Vale.X64.InsBasic.vale_heap",
"Vale.X64.Memory.nat64",
"Vale.X64.Flags.t",
"Prims.l_imp",
"Prims.int",
"Prims.op_Subtraction",
"Vale.X64.Decls.va_mul_nat",
"Vale.X64.Machine_s.rRax",
"Vale.Curve25519.Fast_defs.pow2_256",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Decls.modifies_buffer",
"Vale.X64.State.vale_state",
"Vale.X64.Decls.va_upd_flags",
"Vale.X64.Decls.va_upd_mem_heaplet",
"Vale.X64.Decls.va_upd_reg64",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_upd_mem"
] | [] | false | false | false | true | true | let va_wp_Fast_sub1 (dst_b inA_b: buffer64) (va_s0: va_state) (va_k: (va_state -> unit -> Type0))
: Type0 =
| (va_get_ok va_s0 /\
(let a0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in
let a1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in
let a2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0)
in
let a3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in
let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRdi va_s0)
dst_b
4
(va_get_mem_layout va_s0)
Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0)
inA_b
4
(va_get_mem_layout va_s0)
Secret) /\
(forall (va_x_mem: vale_heap)
(va_x_rax: nat64)
(va_x_r8: nat64)
(va_x_r9: nat64)
(va_x_r10: nat64)
(va_x_r11: nat64)
(va_x_heap0: vale_heap)
(va_x_efl: Vale.X64.Flags.t).
let va_sM =
va_upd_flags va_x_efl
(va_upd_mem_heaplet 0
va_x_heap0
(va_upd_reg64 rR11
va_x_r11
(va_upd_reg64 rR10
va_x_r10
(va_upd_reg64 rR9
va_x_r9
(va_upd_reg64 rR8
va_x_r8
(va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))
in
va_get_ok va_sM /\
(let a0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in
let a1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in
let a2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0)
in
let a3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in
let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in
let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in
let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in
let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in
let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in
d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM)
dst_b
4
(va_get_mem_layout va_sM)
Secret /\
Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0)
(va_get_mem_heaplet 0 va_sM)) ==>
va_k va_sM (()))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_code_Fast_add | val va_code_Fast_add : va_dummy:unit -> Tot va_code | val va_code_Fast_add : va_dummy:unit -> Tot va_code | let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ()))))))))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 36,
"end_line": 934,
"start_col": 0,
"start_line": 910
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | va_dummy: Prims.unit -> Vale.X64.Decls.va_code | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Vale.X64.Decls.va_Block",
"Vale.X64.Decls.va_CCons",
"Vale.X64.InsBasic.va_code_Xor64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.Machine_s.rRax",
"Vale.X64.InsMem.va_code_Load64_buffer",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRcx",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.InsMem.va_code_Mem64_lemma",
"Vale.X64.InsBasic.va_code_Add64Wrap",
"Vale.X64.Decls.va_opr_code_Mem64",
"Vale.X64.Decls.va_op_reg64_reg64",
"Vale.X64.Machine_s.rRsi",
"Vale.X64.InsMem.va_code_Store64_buffer",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rR10",
"Vale.X64.InsBasic.va_code_Adcx64Wrap",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Decls.va_CNil",
"Vale.X64.Decls.va_code"
] | [] | false | false | false | true | false | let va_code_Fast_add () =
| (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx)
0
Secret)
(va_CCons (va_code_Mem64_lemma ())
(va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi)
0
Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9)
0
Secret)
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx)
8
Secret)
(va_CCons (va_code_Mem64_lemma ())
(va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi)
8
Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10)
8
Secret)
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx)
16
Secret)
(va_CCons (va_code_Mem64_lemma ())
(va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR11)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi)
16
Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11)
16
Secret)
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx)
24
Secret)
(va_CCons (va_code_Mem64_lemma ())
(va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rRbx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi
)
24
Secret))
(va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64
rRdi)
(va_op_reg_opr64_reg64
rRbx)
24
Secret)
(va_CCons (va_code_Adcx64Wrap
(va_op_dst_opr64_reg64
rRax)
(va_op_opr64_reg64
rR8))
(va_CNil ())))))))))
)))))))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_codegen_success_Fast_add | val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool | val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool | let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ())))))))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 90,
"end_line": 965,
"start_col": 0,
"start_line": 938
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Vale.X64.Decls.va_pbool_and",
"Vale.X64.InsBasic.va_codegen_success_Xor64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.Machine_s.rRax",
"Vale.X64.InsMem.va_codegen_success_Load64_buffer",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRcx",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.InsMem.va_codegen_success_Mem64_lemma",
"Vale.X64.InsBasic.va_codegen_success_Add64Wrap",
"Vale.X64.Decls.va_opr_code_Mem64",
"Vale.X64.Decls.va_op_reg64_reg64",
"Vale.X64.Machine_s.rRsi",
"Vale.X64.InsMem.va_codegen_success_Store64_buffer",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rR10",
"Vale.X64.InsBasic.va_codegen_success_Adcx64Wrap",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | false | false | false | true | false | let va_codegen_success_Fast_add () =
| (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx)
0
Secret)
(va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi)
0
Secret))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9)
0
Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0
)
(va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx)
8
Secret)
(va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10
)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi)
8
Secret))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10)
8
Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx)
16
Secret)
(va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64
rR11)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi)
16
Secret))
(va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11)
16
Secret)
(va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx)
24
Secret)
(va_pbool_and (va_codegen_success_Mem64_lemma
())
(va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRbx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi)
24
Secret))
(va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi
)
(va_op_reg_opr64_reg64 rRbx
)
24
Secret)
(va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64
rRax)
(va_op_opr64_reg64 rR8
))
(va_ttrue ()))))))))))))
)))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_wp_Fast_add | val va_wp_Fast_add
(dst_b inA_b inB_b: buffer64)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 | val va_wp_Fast_add
(dst_b inA_b inB_b: buffer64)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 | let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (()))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 62,
"end_line": 1177,
"start_col": 0,
"start_line": 1133
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
inB_b: Vale.X64.Memory.buffer64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Memory.buffer64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Prims.b2t",
"Vale.X64.Decls.va_get_ok",
"Vale.X64.CPU_Features_s.adx_enabled",
"Vale.X64.CPU_Features_s.bmi2_enabled",
"Prims.l_or",
"Vale.X64.Decls.buffers_disjoint",
"Prims.eq2",
"Vale.X64.Decls.validDstAddrs64",
"Vale.X64.Decls.va_get_mem_heaplet",
"Vale.X64.Decls.va_get_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Decls.va_get_mem_layout",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.Decls.validSrcAddrs64",
"Vale.X64.Machine_s.rRsi",
"Vale.X64.Machine_s.rRcx",
"Prims.nat",
"Vale.Curve25519.Fast_defs.pow2_four",
"Vale.Def.Words_s.nat64",
"Vale.X64.Decls.buffer64_read",
"Prims.l_Forall",
"Vale.X64.InsBasic.vale_heap",
"Vale.X64.Memory.nat64",
"Vale.X64.Flags.t",
"Prims.l_imp",
"Prims.int",
"Prims.op_Addition",
"Vale.X64.Decls.modifies_buffer",
"Vale.Curve25519.Fast_defs.pow2_five",
"Vale.X64.Machine_s.rRax",
"Vale.X64.State.vale_state",
"Vale.X64.Decls.va_upd_flags",
"Vale.X64.Decls.va_upd_mem_heaplet",
"Vale.X64.Decls.va_upd_reg64",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_upd_mem"
] | [] | false | false | false | true | true | let va_wp_Fast_add
(dst_b inA_b inB_b: buffer64)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 =
| (va_get_ok va_s0 /\
(let a0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in
let a1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in
let a2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0)
in
let a3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in
let b0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in
let b1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in
let b2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0)
in
let b3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0)
in
let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
let b:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRdi va_s0)
dst_b
4
(va_get_mem_layout va_s0)
Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0)
inA_b
4
(va_get_mem_layout va_s0)
Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRcx va_s0)
inB_b
4
(va_get_mem_layout va_s0)
Secret) /\
(forall (va_x_mem: vale_heap)
(va_x_rax: nat64)
(va_x_r8: nat64)
(va_x_r9: nat64)
(va_x_r10: nat64)
(va_x_r11: nat64)
(va_x_rbx: nat64)
(va_x_heap0: vale_heap)
(va_x_efl: Vale.X64.Flags.t).
let va_sM =
va_upd_flags va_x_efl
(va_upd_mem_heaplet 0
va_x_heap0
(va_upd_reg64 rRbx
va_x_rbx
(va_upd_reg64 rR11
va_x_r11
(va_upd_reg64 rR10
va_x_r10
(va_upd_reg64 rR9
va_x_r9
(va_upd_reg64 rR8
va_x_r8
(va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))
in
va_get_ok va_sM /\
(let a0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in
let a1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in
let a2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0)
in
let a3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in
let b0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in
let b1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in
let b2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0)
in
let b3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0)
in
let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
let b:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in
let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in
let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in
let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in
let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in
d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM)
dst_b
4
(va_get_mem_layout va_sM)
Secret /\
Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0)
(va_get_mem_heaplet 0 va_sM)) ==>
va_k va_sM (()))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_codegen_success_Fast_sub | val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool | val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool | let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ()))))))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 90,
"end_line": 1267,
"start_col": 0,
"start_line": 1241
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Vale.X64.Decls.va_pbool_and",
"Vale.X64.InsBasic.va_codegen_success_Xor64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.InsMem.va_codegen_success_Load64_buffer",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRsi",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.InsMem.va_codegen_success_Mem64_lemma",
"Vale.X64.InsBasic.va_codegen_success_Sub64Wrap",
"Vale.X64.Decls.va_opr_code_Mem64",
"Vale.X64.Decls.va_op_reg64_reg64",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.InsMem.va_codegen_success_Store64_buffer",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rR9",
"Vale.X64.InsBasic.va_codegen_success_Sbb64",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR11",
"Vale.X64.InsBasic.va_codegen_success_Adc64Wrap",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | false | false | false | true | false | let va_codegen_success_Fast_sub () =
| (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi)
0
Secret)
(va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx)
0
Secret))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8)
0
Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi)
8
Secret)
(va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx)
8
Secret))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9)
8
Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi)
16
Secret)
(va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64
rR10)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx)
16
Secret))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10)
16
Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (
va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi)
24
Secret)
(va_pbool_and (va_codegen_success_Mem64_lemma
())
(va_pbool_and (va_codegen_success_Sbb64 (
va_op_dst_opr64_reg64 rR11)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRcx)
24
Secret))
(va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0
)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11)
24
Secret)
(va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax
)
(va_op_opr64_reg64 rRax)
)
(va_ttrue ()))))))))))))))))
))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_code_Fast_sub | val va_code_Fast_sub : va_dummy:unit -> Tot va_code | val va_code_Fast_sub : va_dummy:unit -> Tot va_code | let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ())))))))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 35,
"end_line": 1237,
"start_col": 0,
"start_line": 1214
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | va_dummy: Prims.unit -> Vale.X64.Decls.va_code | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Vale.X64.Decls.va_Block",
"Vale.X64.Decls.va_CCons",
"Vale.X64.InsBasic.va_code_Xor64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.InsMem.va_code_Load64_buffer",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRsi",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.InsMem.va_code_Mem64_lemma",
"Vale.X64.InsBasic.va_code_Sub64Wrap",
"Vale.X64.Decls.va_opr_code_Mem64",
"Vale.X64.Decls.va_op_reg64_reg64",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.InsMem.va_code_Store64_buffer",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rR9",
"Vale.X64.InsBasic.va_code_Sbb64",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR11",
"Vale.X64.InsBasic.va_code_Adc64Wrap",
"Vale.X64.Decls.va_CNil",
"Vale.X64.Decls.va_code"
] | [] | false | false | false | true | false | let va_code_Fast_sub () =
| (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi)
0
Secret)
(va_CCons (va_code_Mem64_lemma ())
(va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx)
0
Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8)
0
Secret)
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi)
8
Secret)
(va_CCons (va_code_Mem64_lemma ())
(va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx)
8
Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9)
8
Secret)
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0
)
(va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi)
16
Secret)
(va_CCons (va_code_Mem64_lemma ())
(va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10
)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRcx)
16
Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10)
16
Secret)
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi)
24
Secret)
(va_CCons (va_code_Mem64_lemma ())
(va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64
rR11)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRcx)
24
Secret))
(va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi
)
(va_op_reg_opr64_reg64 rR11
)
24
Secret)
(va_CCons (va_code_Adc64Wrap
(va_op_dst_opr64_reg64
rRax)
(va_op_opr64_reg64 rRax
))
(va_CNil ())))))))))))))
))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_codegen_success_Cswap_single | val va_codegen_success_Cswap_single : offset:nat -> Tot va_pbool | val va_codegen_success_Cswap_single : offset:nat -> Tot va_pbool | let va_codegen_success_Cswap_single offset =
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_ttrue ())))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 24,
"end_line": 1549,
"start_col": 0,
"start_line": 1537
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub dst_b inA_b inB_b) (va_wpProof_Fast_sub dst_b inA_b inB_b))
#pop-options
//--
//-- Cswap_single
val va_code_Cswap_single : offset:nat -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap_single offset =
(va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 +
offset `op_Multiply` 8) Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_CNil ())))))))))
val va_codegen_success_Cswap_single : offset:nat -> Tot va_pbool | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | offset: Prims.nat -> Vale.X64.Decls.va_pbool | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"Vale.X64.Decls.va_pbool_and",
"Vale.X64.InsMem.va_codegen_success_Load64_buffer",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRsi",
"Prims.op_Addition",
"Prims.op_Multiply",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.InsBasic.va_codegen_success_Mov64",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.InsBasic.va_codegen_success_Cmovc64",
"Vale.X64.InsMem.va_codegen_success_Store64_buffer",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | false | false | false | true | false | let va_codegen_success_Cswap_single offset =
| (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi)
(0 + offset `op_Multiply` 8)
Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx)
(0 + offset `op_Multiply` 8)
Secret)
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)
)
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR9)
(va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi)
(va_op_reg_opr64_reg64 rR8)
(0 + offset `op_Multiply` 8)
Secret)
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0
)
(va_op_reg_opr64_reg64 rRdx)
(va_op_reg_opr64_reg64 rR9)
(0 + offset `op_Multiply` 8)
Secret)
(va_ttrue ())))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_qcode_Cswap_single | val va_qcode_Cswap_single (va_mods: va_mods_t) (offset: nat) (p0_b p1_b: buffer64)
: (va_quickCode unit (va_code_Cswap_single offset)) | val va_qcode_Cswap_single (va_mods: va_mods_t) (offset: nat) (p0_b p1_b: buffer64)
: (va_quickCode unit (va_code_Cswap_single offset)) | let va_qcode_Cswap_single (va_mods:va_mods_t) (offset:nat) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap_single offset)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 839 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 840 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 841 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 842 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 843 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 844 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi)
(va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 845 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdx)
(va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QEmpty
(())))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 17,
"end_line": 1579,
"start_col": 0,
"start_line": 1552
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub dst_b inA_b inB_b) (va_wpProof_Fast_sub dst_b inA_b inB_b))
#pop-options
//--
//-- Cswap_single
val va_code_Cswap_single : offset:nat -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap_single offset =
(va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 +
offset `op_Multiply` 8) Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_CNil ())))))))))
val va_codegen_success_Cswap_single : offset:nat -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap_single offset =
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_ttrue ())))))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
va_mods: Vale.X64.QuickCode.va_mods_t ->
offset: Prims.nat ->
p0_b: Vale.X64.Memory.buffer64 ->
p1_b: Vale.X64.Memory.buffer64
-> Vale.X64.QuickCode.va_quickCode Prims.unit
(Vale.Curve25519.X64.FastUtil.va_code_Cswap_single offset) | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.QuickCode.va_mods_t",
"Prims.nat",
"Vale.X64.Memory.buffer64",
"Vale.X64.QuickCodes.qblock",
"Prims.unit",
"Prims.Cons",
"Vale.X64.Decls.va_code",
"Vale.X64.InsMem.va_code_Load64_buffer",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRsi",
"Prims.op_Addition",
"Prims.op_Multiply",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.InsBasic.va_code_Mov64",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.InsBasic.va_code_Cmovc64",
"Vale.X64.InsMem.va_code_Store64_buffer",
"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.InsMem.va_quick_Load64_buffer",
"Vale.X64.InsBasic.va_quick_Mov64",
"Vale.X64.InsBasic.va_quick_Cmovc64",
"Vale.X64.InsMem.va_quick_Store64_buffer",
"Vale.X64.QuickCodes.va_QEmpty",
"Vale.Def.Words_s.nat64",
"Vale.X64.Decls.buffer64_read",
"Vale.X64.Decls.va_get_mem_heaplet",
"Vale.X64.State.vale_state",
"Vale.X64.QuickCodes.quickCodes",
"Vale.X64.QuickCode.va_quickCode",
"Vale.Curve25519.X64.FastUtil.va_code_Cswap_single"
] | [] | false | false | false | false | false | let va_qcode_Cswap_single (va_mods: va_mods_t) (offset: nat) (p0_b p1_b: buffer64)
: (va_quickCode unit (va_code_Cswap_single offset)) =
| (qblock va_mods
(fun (va_s: va_state) ->
let va_old_s:va_state = va_s in
let old_p0_val:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_s)
in
let old_p1_val:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s)
in
va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 839 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi)
(0 + offset `op_Multiply` 8)
Secret
p0_b
(0 + offset))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 840 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx)
(0 + offset `op_Multiply` 8)
Secret
p1_b
(0 + offset))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 841 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 842 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 843 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 844 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi)
(va_op_reg_opr64_reg64 rR8)
(0 + offset `op_Multiply` 8)
Secret
p0_b
(0 + offset))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 845 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx)
(va_op_reg_opr64_reg64 rR9)
(0 + offset `op_Multiply` 8)
Secret
p1_b
(0 + offset))
(va_QEmpty (())))))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_code_Cswap_single | val va_code_Cswap_single : offset:nat -> Tot va_code | val va_code_Cswap_single : offset:nat -> Tot va_code | let va_code_Cswap_single offset =
(va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 +
offset `op_Multiply` 8) Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_CNil ()))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 24,
"end_line": 1533,
"start_col": 0,
"start_line": 1522
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub dst_b inA_b inB_b) (va_wpProof_Fast_sub dst_b inA_b inB_b))
#pop-options
//--
//-- Cswap_single
val va_code_Cswap_single : offset:nat -> Tot va_code | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | offset: Prims.nat -> Vale.X64.Decls.va_code | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"Vale.X64.Decls.va_Block",
"Vale.X64.Decls.va_CCons",
"Vale.X64.InsMem.va_code_Load64_buffer",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRsi",
"Prims.op_Addition",
"Prims.op_Multiply",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.InsBasic.va_code_Mov64",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.InsBasic.va_code_Cmovc64",
"Vale.X64.InsMem.va_code_Store64_buffer",
"Vale.X64.Decls.va_CNil",
"Vale.X64.Decls.va_code"
] | [] | false | false | false | true | false | let va_code_Cswap_single offset =
| (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi)
(0 + offset `op_Multiply` 8)
Secret)
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx)
(0 + offset `op_Multiply` 8)
Secret)
(va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8))
(va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9))
(va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi)
(va_op_reg_opr64_reg64 rR8)
(0 + offset `op_Multiply` 8)
Secret)
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx)
(va_op_reg_opr64_reg64 rR9)
(0 + offset `op_Multiply` 8)
Secret)
(va_CNil ()))))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_wp_Fast_sub | val va_wp_Fast_sub
(dst_b inA_b inB_b: buffer64)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 | val va_wp_Fast_sub
(dst_b inA_b inB_b: buffer64)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 | let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (()))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 25,
"end_line": 1488,
"start_col": 0,
"start_line": 1444
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
inB_b: Vale.X64.Memory.buffer64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Memory.buffer64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Prims.b2t",
"Vale.X64.Decls.va_get_ok",
"Prims.l_or",
"Vale.X64.Decls.buffers_disjoint",
"Prims.eq2",
"Vale.X64.Decls.validDstAddrs64",
"Vale.X64.Decls.va_get_mem_heaplet",
"Vale.X64.Decls.va_get_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Decls.va_get_mem_layout",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.Decls.validSrcAddrs64",
"Vale.X64.Machine_s.rRsi",
"Vale.X64.Machine_s.rRcx",
"Prims.nat",
"Vale.Curve25519.Fast_defs.pow2_four",
"Vale.Def.Words_s.nat64",
"Vale.X64.Decls.buffer64_read",
"Prims.l_Forall",
"Vale.X64.InsBasic.vale_heap",
"Vale.X64.Memory.nat64",
"Vale.X64.Flags.t",
"Prims.l_imp",
"Prims.int",
"Prims.op_Subtraction",
"Vale.X64.Decls.va_mul_nat",
"Vale.X64.Machine_s.rRax",
"Vale.Curve25519.Fast_defs.pow2_256",
"Vale.X64.Decls.modifies_buffer",
"Vale.X64.State.vale_state",
"Vale.X64.Decls.va_upd_flags",
"Vale.X64.Decls.va_upd_mem_heaplet",
"Vale.X64.Decls.va_upd_reg64",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_upd_mem"
] | [] | false | false | false | true | true | let va_wp_Fast_sub
(dst_b inA_b inB_b: buffer64)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 =
| (va_get_ok va_s0 /\
(let a0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in
let a1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in
let a2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0)
in
let a3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in
let b0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in
let b1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in
let b2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0)
in
let b3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0)
in
let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
let b:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRdi va_s0)
dst_b
4
(va_get_mem_layout va_s0)
Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0)
inA_b
4
(va_get_mem_layout va_s0)
Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRcx va_s0)
inB_b
4
(va_get_mem_layout va_s0)
Secret) /\
(forall (va_x_mem: vale_heap)
(va_x_rax: nat64)
(va_x_r8: nat64)
(va_x_r9: nat64)
(va_x_r10: nat64)
(va_x_r11: nat64)
(va_x_heap0: vale_heap)
(va_x_efl: Vale.X64.Flags.t).
let va_sM =
va_upd_flags va_x_efl
(va_upd_mem_heaplet 0
va_x_heap0
(va_upd_reg64 rR11
va_x_r11
(va_upd_reg64 rR10
va_x_r10
(va_upd_reg64 rR9
va_x_r9
(va_upd_reg64 rR8
va_x_r8
(va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))
in
va_get_ok va_sM /\
(let a0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in
let a1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in
let a2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0)
in
let a3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in
let b0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in
let b1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in
let b2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0)
in
let b3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0)
in
let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
let b:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in
let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in
let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in
let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in
let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in
d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM)
dst_b
4
(va_get_mem_layout va_sM)
Secret /\
Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0)
(va_get_mem_heaplet 0 va_sM)) ==>
va_k va_sM (()))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_wp_Cswap_single | val va_wp_Cswap_single
(offset: nat)
(p0_b p1_b: buffer64)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 | val va_wp_Cswap_single
(offset: nat)
(p0_b p1_b: buffer64)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 | let va_wp_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
(0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall
(va_x_mem:vale_heap) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_heap0:vale_heap) .
let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9
va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_mem va_x_mem va_s0)))) in va_get_ok va_sM /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == va_if
(Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ -> old_p0_val) /\ p1_val
== va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ -> old_p1_val)))
==> va_k va_sM (()))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 25,
"end_line": 1681,
"start_col": 0,
"start_line": 1654
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub dst_b inA_b inB_b) (va_wpProof_Fast_sub dst_b inA_b inB_b))
#pop-options
//--
//-- Cswap_single
val va_code_Cswap_single : offset:nat -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap_single offset =
(va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 +
offset `op_Multiply` 8) Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_CNil ())))))))))
val va_codegen_success_Cswap_single : offset:nat -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap_single offset =
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_ttrue ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap_single (va_mods:va_mods_t) (offset:nat) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap_single offset)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 839 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 840 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 841 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 842 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 843 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 844 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi)
(va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 845 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdx)
(va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QEmpty
(()))))))))))
val va_lemma_Cswap_single : va_b0:va_code -> va_s0:va_state -> offset:nat -> p0_b:buffer64 ->
p1_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cswap_single offset) va_s0 /\ va_get_ok va_s0 /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p1_val else old_p0_val) /\ p1_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p0_val else old_p1_val))) /\ va_state_eq va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))
[@"opaque_to_smt"]
let va_lemma_Cswap_single va_b0 va_s0 offset p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap_single va_mods offset p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap_single offset) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 792 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 821 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 822 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdx va_sM) p1_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 824 column 57 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 832 column 59 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read p0_b i
(va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet 0
va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 834 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_val = Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 835 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_val = Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 836 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ ->
old_p0_val)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 837 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ ->
old_p1_val)))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
offset: Prims.nat ->
p0_b: Vale.X64.Memory.buffer64 ->
p1_b: Vale.X64.Memory.buffer64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"Vale.X64.Memory.buffer64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Prims.b2t",
"Vale.X64.Decls.va_get_ok",
"Prims.op_LessThan",
"Prims.l_or",
"Vale.X64.Decls.buffers_disjoint",
"Prims.eq2",
"Vale.X64.Decls.validDstAddrs64",
"Vale.X64.Decls.va_get_mem_heaplet",
"Vale.X64.Decls.va_get_reg64",
"Vale.X64.Machine_s.rRsi",
"Vale.X64.Decls.va_get_mem_layout",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Decls.valid_cf",
"Vale.X64.Decls.va_get_flags",
"Vale.Def.Words_s.nat64",
"Vale.X64.Decls.buffer64_read",
"Prims.op_Addition",
"Prims.l_Forall",
"Vale.X64.InsBasic.vale_heap",
"Vale.X64.Memory.nat64",
"Prims.l_imp",
"Vale.X64.Decls.validSrcAddrs64",
"Vale.X64.Decls.modifies_buffer_2",
"Prims.op_LessThanOrEqual",
"Prims.l_not",
"Vale.Def.Types_s.nat64",
"Vale.X64.Decls.va_if",
"Vale.X64.Decls.cf",
"Vale.X64.State.vale_state",
"Vale.X64.Decls.va_upd_mem_heaplet",
"Vale.X64.Decls.va_upd_reg64",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_upd_mem"
] | [] | false | false | false | true | true | let va_wp_Cswap_single
(offset: nat)
(p0_b p1_b: buffer64)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 =
| (va_get_ok va_s0 /\
(let old_p0_val:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_s0)
in
let old_p1_val:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0)
in
offset < 8 /\ (Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0)
p0_b
8
(va_get_mem_layout va_s0)
Secret /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRdx va_s0)
p1_b
8
(va_get_mem_layout va_s0)
Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\
(forall (va_x_mem: vale_heap)
(va_x_r8: nat64)
(va_x_r9: nat64)
(va_x_r10: nat64)
(va_x_heap0: vale_heap).
let va_sM =
va_upd_mem_heaplet 0
va_x_heap0
(va_upd_reg64 rR10
va_x_r10
(va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_mem va_x_mem va_s0))))
in
va_get_ok va_sM /\
(let old_p0_val:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_s0)
in
let old_p1_val:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0)
in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRsi va_sM)
p0_b
8
(va_get_mem_layout va_sM)
Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM)
p1_b
8
(va_get_mem_layout va_sM)
Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b
p1_b
(va_get_mem_heaplet 0 va_s0)
(va_get_mem_heaplet 0 va_sM) /\
(forall (i: nat).
0 <= i /\ i < 8 /\ i =!= offset ==>
Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet 0 va_s0) /\
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\
(let p0_val = Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM)
in
p0_val ==
va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ -> old_p0_val) /\
p1_val ==
va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ -> old_p1_val)
)) ==>
va_k va_sM (()))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_code_Cswap2 | val va_code_Cswap2 : va_dummy:unit -> Tot va_code | val va_code_Cswap2 : va_dummy:unit -> Tot va_code | let va_code_Cswap2 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Transfer bit into CF flag"
) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[0], p2[0]"
) (va_CCons (va_code_Cswap_single 0) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[1], p2[1]"
) (va_CCons (va_code_Cswap_single 1) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[2], p2[2]"
) (va_CCons (va_code_Cswap_single 2) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[3], p2[3]"
) (va_CCons (va_code_Cswap_single 3) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[4], p2[4]"
) (va_CCons (va_code_Cswap_single 4) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[5], p2[5]"
) (va_CCons (va_code_Cswap_single 5) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[6], p2[6]"
) (va_CCons (va_code_Cswap_single 6) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[7], p2[7]"
) (va_CCons (va_code_Cswap_single 7) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil
())))))))))))))))))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 36,
"end_line": 1734,
"start_col": 0,
"start_line": 1713
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub dst_b inA_b inB_b) (va_wpProof_Fast_sub dst_b inA_b inB_b))
#pop-options
//--
//-- Cswap_single
val va_code_Cswap_single : offset:nat -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap_single offset =
(va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 +
offset `op_Multiply` 8) Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_CNil ())))))))))
val va_codegen_success_Cswap_single : offset:nat -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap_single offset =
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_ttrue ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap_single (va_mods:va_mods_t) (offset:nat) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap_single offset)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 839 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 840 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 841 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 842 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 843 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 844 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi)
(va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 845 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdx)
(va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QEmpty
(()))))))))))
val va_lemma_Cswap_single : va_b0:va_code -> va_s0:va_state -> offset:nat -> p0_b:buffer64 ->
p1_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cswap_single offset) va_s0 /\ va_get_ok va_s0 /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p1_val else old_p0_val) /\ p1_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p0_val else old_p1_val))) /\ va_state_eq va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))
[@"opaque_to_smt"]
let va_lemma_Cswap_single va_b0 va_s0 offset p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap_single va_mods offset p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap_single offset) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 792 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 821 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 822 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdx va_sM) p1_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 824 column 57 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 832 column 59 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read p0_b i
(va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet 0
va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 834 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_val = Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 835 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_val = Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 836 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ ->
old_p0_val)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 837 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ ->
old_p1_val)))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
(0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall
(va_x_mem:vale_heap) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_heap0:vale_heap) .
let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9
va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_mem va_x_mem va_s0)))) in va_get_ok va_sM /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == va_if
(Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ -> old_p0_val) /\ p1_val
== va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ -> old_p1_val)))
==> va_k va_sM (())))
val va_wpProof_Cswap_single : offset:nat -> p0_b:buffer64 -> p1_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cswap_single offset p0_b p1_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cswap_single offset)
([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Cswap_single offset p0_b p1_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cswap_single (va_code_Cswap_single offset) va_s0 offset p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))));
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) : (va_quickCode unit
(va_code_Cswap_single offset)) =
(va_QProc (va_code_Cswap_single offset) ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_mem]) (va_wp_Cswap_single offset p0_b p1_b)
(va_wpProof_Cswap_single offset p0_b p1_b))
//--
//-- Cswap2 | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | va_dummy: Prims.unit -> Vale.X64.Decls.va_code | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Vale.X64.Decls.va_Block",
"Vale.X64.Decls.va_CCons",
"Vale.X64.InsMem.va_code_CreateHeaplets",
"Vale.X64.InsBasic.va_code_Comment",
"Vale.X64.InsBasic.va_code_Add64Wrap",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Decls.va_const_opr64",
"Vale.X64.InsBasic.va_code_Newline",
"Vale.Curve25519.X64.FastUtil.va_code_Cswap_single",
"Vale.X64.InsMem.va_code_DestroyHeaplets",
"Vale.X64.Decls.va_CNil",
"Vale.X64.Decls.va_code"
] | [] | false | false | false | true | false | let va_code_Cswap2 () =
| (va_Block (va_CCons (va_code_CreateHeaplets ())
(va_CCons (va_code_Comment "Transfer bit into CF flag")
(va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdi)
(va_const_opr64 18446744073709551615))
(va_CCons (va_code_Newline ())
(va_CCons (va_code_Comment "cswap p1[0], p2[0]")
(va_CCons (va_code_Cswap_single 0)
(va_CCons (va_code_Newline ())
(va_CCons (va_code_Comment "cswap p1[1], p2[1]")
(va_CCons (va_code_Cswap_single 1)
(va_CCons (va_code_Newline ())
(va_CCons (va_code_Comment "cswap p1[2], p2[2]")
(va_CCons (va_code_Cswap_single 2)
(va_CCons (va_code_Newline ())
(va_CCons (va_code_Comment "cswap p1[3], p2[3]"
)
(va_CCons (va_code_Cswap_single 3)
(va_CCons (va_code_Newline ())
(va_CCons (va_code_Comment "cswap p1[4], p2[4]"
)
(va_CCons (va_code_Cswap_single
4)
(va_CCons (va_code_Newline
())
(va_CCons (va_code_Comment
"cswap p1[5], p2[5]"
)
(va_CCons (va_code_Cswap_single
5)
(va_CCons (va_code_Newline
())
(va_CCons
(va_code_Comment
"cswap p1[6], p2[6]"
)
(va_CCons
(
va_code_Cswap_single
6
)
(
va_CCons
(
va_code_Newline
()
)
(
va_CCons
(
va_code_Comment
"cswap p1[7], p2[7]"
)
(
va_CCons
(
va_code_Cswap_single
7
)
(
va_CCons
(
va_code_DestroyHeaplets
()
)
(
va_CNil
()
)
)
)
)
)
))
))))))))))))
))))))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_quick_Fast_mul1 | val va_quick_Fast_mul1 (dst_b inA_b: buffer64) : (va_quickCode unit (va_code_Fast_mul1 ())) | val va_quick_Fast_mul1 (dst_b inA_b: buffer64) : (va_quickCode unit (va_code_Fast_mul1 ())) | let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b)) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 39,
"end_line": 306,
"start_col": 0,
"start_line": 301
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64
-> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastUtil.va_code_Fast_mul1 ()) | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Memory.buffer64",
"Vale.X64.QuickCode.va_QProc",
"Prims.unit",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_mul1",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_Mod_mem_heaplet",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rR14",
"Vale.X64.Machine_s.rR13",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Machine_s.rRax",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"Vale.Curve25519.X64.FastUtil.va_wp_Fast_mul1",
"Vale.Curve25519.X64.FastUtil.va_wpProof_Fast_mul1",
"Vale.X64.QuickCode.va_quickCode"
] | [] | false | false | false | false | false | let va_quick_Fast_mul1 (dst_b inA_b: buffer64) : (va_quickCode unit (va_code_Fast_mul1 ())) =
| (va_QProc (va_code_Fast_mul1 ())
([
va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem
])
(va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b)) | false |
Pulse.Lib.HashTable.Type.fst | Pulse.Lib.HashTable.Type.token | val token (#k:eqtype) (#v:Type0)
(r:ref (ht_t k v))
(r_sz:ref pos_us)
(r_hashf:ref (k -> SZ.t))
(r_contents:ref (V.vec (cell k v))) : vprop | val token (#k:eqtype) (#v:Type0)
(r:ref (ht_t k v))
(r_sz:ref pos_us)
(r_hashf:ref (k -> SZ.t))
(r_contents:ref (V.vec (cell k v))) : vprop | let token (#k:eqtype) (#v:Type0)
(r:ref (ht_t k v))
(r_sz:ref pos_us)
(r_hashf:ref (k -> SZ.t))
(r_contents:ref (V.vec (cell k v))) : vprop =
exists* ht. pts_to r ht | {
"file_name": "share/steel/examples/pulse/lib/Pulse.Lib.HashTable.Type.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 25,
"end_line": 29,
"start_col": 0,
"start_line": 24
} | (*
Copyright 2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Pulse.Lib.HashTable.Type
open Pulse.Lib.Pervasives
module V = Pulse.Lib.Vec
module R = Pulse.Lib.Reference
module SZ = FStar.SizeT | {
"checked_file": "/",
"dependencies": [
"Pulse.Lib.Vec.fsti.checked",
"Pulse.Lib.Reference.fsti.checked",
"Pulse.Lib.Pervasives.fst.checked",
"prims.fst.checked",
"FStar.SizeT.fsti.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Pulse.Lib.HashTable.Type.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.SizeT",
"short_module": "SZ"
},
{
"abbrev": true,
"full_module": "Pulse.Lib.Reference",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "Pulse.Lib.Vec",
"short_module": "V"
},
{
"abbrev": false,
"full_module": "Pulse.Lib.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Lib.HashTable.Spec",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.SizeT",
"short_module": "SZ"
},
{
"abbrev": true,
"full_module": "Pulse.Lib.Reference",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "Pulse.Lib.Vec",
"short_module": "V"
},
{
"abbrev": false,
"full_module": "Pulse.Lib.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Lib.HashTable",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Lib.HashTable",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
r: Pulse.Lib.Reference.ref (Pulse.Lib.HashTable.Type.ht_t k v) ->
r_sz: Pulse.Lib.Reference.ref Pulse.Lib.HashTable.Type.pos_us ->
r_hashf: Pulse.Lib.Reference.ref (_: k -> FStar.SizeT.t) ->
r_contents: Pulse.Lib.Reference.ref (Pulse.Lib.Vec.vec (Pulse.Lib.HashTable.Spec.cell k v))
-> Pulse.Lib.Core.vprop | Prims.Tot | [
"total"
] | [] | [
"Prims.eqtype",
"Pulse.Lib.Reference.ref",
"Pulse.Lib.HashTable.Type.ht_t",
"Pulse.Lib.HashTable.Type.pos_us",
"FStar.SizeT.t",
"Pulse.Lib.Vec.vec",
"Pulse.Lib.HashTable.Spec.cell",
"Pulse.Lib.Core.op_exists_Star",
"Pulse.Lib.Reference.pts_to",
"PulseCore.FractionalPermission.full_perm",
"Pulse.Lib.Core.vprop"
] | [] | false | false | false | false | false | let token
(#k: eqtype)
(#v: Type0)
(r: ref (ht_t k v))
(r_sz: ref pos_us)
(r_hashf: ref (k -> SZ.t))
(r_contents: ref (V.vec (cell k v)))
: vprop =
| exists* ht. pts_to r ht | false |
Pulse.Lib.HashTable.Type.fst | Pulse.Lib.HashTable.Type.explode_ref_ht_t | val explode_ref_ht_t (#k:eqtype) (#v:Type0) (#ht:erased (ht_t k v)) (r:ref (ht_t k v))
: stt (ref pos_us & ref (k -> SZ.t) & ref (V.vec (cell k v)))
(requires pts_to r ht)
(ensures fun res -> exploded_vp r ht (tfst res) (tsnd res) (tthd res)) | val explode_ref_ht_t (#k:eqtype) (#v:Type0) (#ht:erased (ht_t k v)) (r:ref (ht_t k v))
: stt (ref pos_us & ref (k -> SZ.t) & ref (V.vec (cell k v)))
(requires pts_to r ht)
(ensures fun res -> exploded_vp r ht (tfst res) (tsnd res) (tthd res)) | let explode_ref_ht_t = explode_ref_ht_t' | {
"file_name": "share/steel/examples/pulse/lib/Pulse.Lib.HashTable.Type.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 40,
"end_line": 51,
"start_col": 0,
"start_line": 51
} | (*
Copyright 2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Pulse.Lib.HashTable.Type
open Pulse.Lib.Pervasives
module V = Pulse.Lib.Vec
module R = Pulse.Lib.Reference
module SZ = FStar.SizeT
let token (#k:eqtype) (#v:Type0)
(r:ref (ht_t k v))
(r_sz:ref pos_us)
(r_hashf:ref (k -> SZ.t))
(r_contents:ref (V.vec (cell k v))) : vprop =
exists* ht. pts_to r ht
```pulse
fn explode_ref_ht_t' (#k:eqtype) (#v:Type0) (#ht:erased (ht_t k v)) (r:ref (ht_t k v))
requires pts_to r ht
returns res:(ref pos_us & ref (k -> SZ.t) & ref (V.vec (cell k v)))
ensures exploded_vp r ht (tfst res) (tsnd res) (tthd res)
{
let htc = !r;
let r_sz = R.alloc htc.sz;
let r_hashf = R.alloc htc.hashf;
let r_contents = R.alloc htc.contents;
let res = (r_sz, r_hashf, r_contents);
fold (token r r_sz r_hashf r_contents);
fold (exploded_vp r ht r_sz r_hashf r_contents);
rewrite (exploded_vp r ht r_sz r_hashf r_contents)
as (exploded_vp r ht (tfst res) (tsnd res) (tthd res));
res
}
``` | {
"checked_file": "/",
"dependencies": [
"Pulse.Lib.Vec.fsti.checked",
"Pulse.Lib.Reference.fsti.checked",
"Pulse.Lib.Pervasives.fst.checked",
"prims.fst.checked",
"FStar.SizeT.fsti.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Pulse.Lib.HashTable.Type.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.SizeT",
"short_module": "SZ"
},
{
"abbrev": true,
"full_module": "Pulse.Lib.Reference",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "Pulse.Lib.Vec",
"short_module": "V"
},
{
"abbrev": false,
"full_module": "Pulse.Lib.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Lib.HashTable.Spec",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.SizeT",
"short_module": "SZ"
},
{
"abbrev": true,
"full_module": "Pulse.Lib.Reference",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "Pulse.Lib.Vec",
"short_module": "V"
},
{
"abbrev": false,
"full_module": "Pulse.Lib.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Lib.HashTable",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Lib.HashTable",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | r: Pulse.Lib.Reference.ref (Pulse.Lib.HashTable.Type.ht_t k v)
-> Pulse.Lib.Core.stt ((Pulse.Lib.Reference.ref Pulse.Lib.HashTable.Type.pos_us *
Pulse.Lib.Reference.ref (_: k -> FStar.SizeT.t)) *
Pulse.Lib.Reference.ref (Pulse.Lib.Vec.vec (Pulse.Lib.HashTable.Spec.cell k v)))
(Pulse.Lib.Reference.pts_to r (FStar.Ghost.reveal ht))
(fun res ->
Pulse.Lib.HashTable.Type.exploded_vp r
(FStar.Ghost.reveal ht)
(Pulse.Lib.Pervasives.tfst res)
(Pulse.Lib.Pervasives.tsnd res)
(Pulse.Lib.Pervasives.tthd res)) | Prims.Tot | [
"total"
] | [] | [
"Pulse.Lib.HashTable.Type.explode_ref_ht_t'"
] | [] | false | false | false | false | false | let explode_ref_ht_t =
| explode_ref_ht_t' | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_codegen_success_Cswap2 | val va_codegen_success_Cswap2 : va_dummy:unit -> Tot va_pbool | val va_codegen_success_Cswap2 : va_dummy:unit -> Tot va_pbool | let va_codegen_success_Cswap2 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Transfer bit into CF flag"
) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64
18446744073709551615)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and
(va_codegen_success_Comment
"cswap p1[0], p2[0]"
) (va_pbool_and (va_codegen_success_Cswap_single 0) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[1], p2[1]"
) (va_pbool_and (va_codegen_success_Cswap_single 1) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[2], p2[2]"
) (va_pbool_and (va_codegen_success_Cswap_single 2) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[3], p2[3]"
) (va_pbool_and (va_codegen_success_Cswap_single 3) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[4], p2[4]"
) (va_pbool_and (va_codegen_success_Cswap_single 4) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[5], p2[5]"
) (va_pbool_and (va_codegen_success_Cswap_single 5) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[6], p2[6]"
) (va_pbool_and (va_codegen_success_Cswap_single 6) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[7], p2[7]"
) (va_pbool_and (va_codegen_success_Cswap_single 7) (va_pbool_and
(va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))))))))))))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 85,
"end_line": 1766,
"start_col": 0,
"start_line": 1737
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub dst_b inA_b inB_b) (va_wpProof_Fast_sub dst_b inA_b inB_b))
#pop-options
//--
//-- Cswap_single
val va_code_Cswap_single : offset:nat -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap_single offset =
(va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 +
offset `op_Multiply` 8) Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_CNil ())))))))))
val va_codegen_success_Cswap_single : offset:nat -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap_single offset =
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_ttrue ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap_single (va_mods:va_mods_t) (offset:nat) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap_single offset)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 839 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 840 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 841 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 842 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 843 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 844 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi)
(va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 845 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdx)
(va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QEmpty
(()))))))))))
val va_lemma_Cswap_single : va_b0:va_code -> va_s0:va_state -> offset:nat -> p0_b:buffer64 ->
p1_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cswap_single offset) va_s0 /\ va_get_ok va_s0 /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p1_val else old_p0_val) /\ p1_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p0_val else old_p1_val))) /\ va_state_eq va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))
[@"opaque_to_smt"]
let va_lemma_Cswap_single va_b0 va_s0 offset p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap_single va_mods offset p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap_single offset) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 792 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 821 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 822 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdx va_sM) p1_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 824 column 57 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 832 column 59 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read p0_b i
(va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet 0
va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 834 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_val = Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 835 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_val = Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 836 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ ->
old_p0_val)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 837 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ ->
old_p1_val)))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
(0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall
(va_x_mem:vale_heap) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_heap0:vale_heap) .
let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9
va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_mem va_x_mem va_s0)))) in va_get_ok va_sM /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == va_if
(Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ -> old_p0_val) /\ p1_val
== va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ -> old_p1_val)))
==> va_k va_sM (())))
val va_wpProof_Cswap_single : offset:nat -> p0_b:buffer64 -> p1_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cswap_single offset p0_b p1_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cswap_single offset)
([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Cswap_single offset p0_b p1_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cswap_single (va_code_Cswap_single offset) va_s0 offset p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))));
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) : (va_quickCode unit
(va_code_Cswap_single offset)) =
(va_QProc (va_code_Cswap_single offset) ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_mem]) (va_wp_Cswap_single offset p0_b p1_b)
(va_wpProof_Cswap_single offset p0_b p1_b))
//--
//-- Cswap2
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap2 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Transfer bit into CF flag"
) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[0], p2[0]"
) (va_CCons (va_code_Cswap_single 0) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[1], p2[1]"
) (va_CCons (va_code_Cswap_single 1) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[2], p2[2]"
) (va_CCons (va_code_Cswap_single 2) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[3], p2[3]"
) (va_CCons (va_code_Cswap_single 3) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[4], p2[4]"
) (va_CCons (va_code_Cswap_single 4) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[5], p2[5]"
) (va_CCons (va_code_Cswap_single 5) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[6], p2[6]"
) (va_CCons (va_code_Cswap_single 6) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[7], p2[7]"
) (va_CCons (va_code_Cswap_single 7) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil
())))))))))))))))))))))))))))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Vale.X64.Decls.va_pbool_and",
"Vale.X64.InsMem.va_codegen_success_CreateHeaplets",
"Vale.X64.InsBasic.va_codegen_success_Comment",
"Vale.X64.InsBasic.va_codegen_success_Add64Wrap",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Decls.va_const_opr64",
"Vale.X64.InsBasic.va_codegen_success_Newline",
"Vale.Curve25519.X64.FastUtil.va_codegen_success_Cswap_single",
"Vale.X64.InsMem.va_codegen_success_DestroyHeaplets",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | false | false | false | true | false | let va_codegen_success_Cswap2 () =
| (va_pbool_and (va_codegen_success_CreateHeaplets ())
(va_pbool_and (va_codegen_success_Comment "Transfer bit into CF flag")
(va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rRdi)
(va_const_opr64 18446744073709551615))
(va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment "cswap p1[0], p2[0]")
(va_pbool_and (va_codegen_success_Cswap_single 0)
(va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment "cswap p1[1], p2[1]")
(va_pbool_and (va_codegen_success_Cswap_single 1)
(va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment "cswap p1[2], p2[2]"
)
(va_pbool_and (va_codegen_success_Cswap_single 2)
(va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment "cswap p1[3], p2[3]"
)
(va_pbool_and (va_codegen_success_Cswap_single
3)
(va_pbool_and (va_codegen_success_Newline
())
(va_pbool_and (va_codegen_success_Comment
"cswap p1[4], p2[4]")
(va_pbool_and (va_codegen_success_Cswap_single
4)
(va_pbool_and (va_codegen_success_Newline
())
(va_pbool_and (va_codegen_success_Comment
"cswap p1[5], p2[5]"
)
(va_pbool_and (va_codegen_success_Cswap_single
5)
(va_pbool_and (va_codegen_success_Newline
())
(va_pbool_and
(va_codegen_success_Comment
"cswap p1[6], p2[6]"
)
(va_pbool_and
(va_codegen_success_Cswap_single
6
)
(va_pbool_and
(
va_codegen_success_Newline
()
)
(
va_pbool_and
(
va_codegen_success_Comment
"cswap p1[7], p2[7]"
)
(
va_pbool_and
(
va_codegen_success_Cswap_single
7
)
(
va_pbool_and
(
va_codegen_success_DestroyHeaplets
()
)
(
va_ttrue
()
)
)
)
)
))
))))))))))))
))))))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_wpProof_Fast_mul1 | val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g)))) | val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g)))) | let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 22,
"end_line": 298,
"start_col": 0,
"start_line": 287
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g)))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | Prims.Ghost | [] | [] | [
"Vale.X64.Memory.buffer64",
"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_mem_heaplet",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rR14",
"Vale.X64.Machine_s.rR13",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Machine_s.rRax",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_mem_heaplet",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_mem",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.Curve25519.X64.FastUtil.va_lemma_Fast_mul1",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_mul1"
] | [] | false | false | false | false | false | let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
| let va_sM, va_f0 = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM
(va_update_mem_heaplet 0
va_sM
(va_update_reg64 rR14
va_sM
(va_update_reg64 rR13
va_sM
(va_update_reg64 rRbx
va_sM
(va_update_reg64 rR11
va_sM
(va_update_reg64 rR10
va_sM
(va_update_reg64 rR9
va_sM
(va_update_reg64 rR8
va_sM
(va_update_reg64 rRax
va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0))))))))
)))));
va_lemma_norm_mods ([
va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem
])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_wpProof_Fast_add1 | val va_wpProof_Fast_add1 : dst_b:buffer64 -> inA_b:buffer64 -> inB:nat64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add1 dst_b inA_b inB va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add1 ()) ([va_Mod_flags;
va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM,
va_f0, va_g)))) | val va_wpProof_Fast_add1 : dst_b:buffer64 -> inA_b:buffer64 -> inB:nat64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add1 dst_b inA_b inB va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add1 ()) ([va_Mod_flags;
va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM,
va_f0, va_g)))) | let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 22,
"end_line": 508,
"start_col": 0,
"start_line": 497
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
inB: Vale.X64.Memory.nat64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | Prims.Ghost | [] | [] | [
"Vale.X64.Memory.buffer64",
"Vale.X64.Memory.nat64",
"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_mem_layout",
"Vale.X64.QuickCode.va_Mod_mem_heaplet",
"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.rR8",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rRax",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_mem_layout",
"Vale.X64.Decls.va_update_mem_heaplet",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_mem",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.Curve25519.X64.FastUtil.va_lemma_Fast_add1",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_add1"
] | [] | false | false | false | false | false | let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
| let va_sM, va_f0 = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM
(va_update_mem_layout va_sM
(va_update_mem_heaplet 0
va_sM
(va_update_reg64 rR11
va_sM
(va_update_reg64 rR10
va_sM
(va_update_reg64 rR9
va_sM
(va_update_reg64 rR8
va_sM
(va_update_reg64 rRdx
va_sM
(va_update_reg64 rRax
va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([
va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem
])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_codegen_success_Cswap2_stdcall | val va_codegen_success_Cswap2_stdcall : win:bool -> Tot va_pbool | val va_codegen_success_Cswap2_stdcall : win:bool -> Tot va_pbool | let va_codegen_success_Cswap2_stdcall win =
(va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64
rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Cswap2 ()) (va_pbool_and
(if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi))
(va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else
va_ttrue ()) (va_ttrue ())))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 33,
"end_line": 2021,
"start_col": 0,
"start_line": 2012
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub dst_b inA_b inB_b) (va_wpProof_Fast_sub dst_b inA_b inB_b))
#pop-options
//--
//-- Cswap_single
val va_code_Cswap_single : offset:nat -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap_single offset =
(va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 +
offset `op_Multiply` 8) Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_CNil ())))))))))
val va_codegen_success_Cswap_single : offset:nat -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap_single offset =
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_ttrue ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap_single (va_mods:va_mods_t) (offset:nat) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap_single offset)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 839 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 840 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 841 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 842 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 843 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 844 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi)
(va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 845 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdx)
(va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QEmpty
(()))))))))))
val va_lemma_Cswap_single : va_b0:va_code -> va_s0:va_state -> offset:nat -> p0_b:buffer64 ->
p1_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cswap_single offset) va_s0 /\ va_get_ok va_s0 /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p1_val else old_p0_val) /\ p1_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p0_val else old_p1_val))) /\ va_state_eq va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))
[@"opaque_to_smt"]
let va_lemma_Cswap_single va_b0 va_s0 offset p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap_single va_mods offset p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap_single offset) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 792 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 821 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 822 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdx va_sM) p1_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 824 column 57 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 832 column 59 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read p0_b i
(va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet 0
va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 834 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_val = Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 835 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_val = Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 836 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ ->
old_p0_val)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 837 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ ->
old_p1_val)))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
(0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall
(va_x_mem:vale_heap) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_heap0:vale_heap) .
let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9
va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_mem va_x_mem va_s0)))) in va_get_ok va_sM /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == va_if
(Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ -> old_p0_val) /\ p1_val
== va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ -> old_p1_val)))
==> va_k va_sM (())))
val va_wpProof_Cswap_single : offset:nat -> p0_b:buffer64 -> p1_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cswap_single offset p0_b p1_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cswap_single offset)
([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Cswap_single offset p0_b p1_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cswap_single (va_code_Cswap_single offset) va_s0 offset p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))));
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) : (va_quickCode unit
(va_code_Cswap_single offset)) =
(va_QProc (va_code_Cswap_single offset) ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_mem]) (va_wp_Cswap_single offset p0_b p1_b)
(va_wpProof_Cswap_single offset p0_b p1_b))
//--
//-- Cswap2
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap2 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Transfer bit into CF flag"
) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[0], p2[0]"
) (va_CCons (va_code_Cswap_single 0) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[1], p2[1]"
) (va_CCons (va_code_Cswap_single 1) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[2], p2[2]"
) (va_CCons (va_code_Cswap_single 2) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[3], p2[3]"
) (va_CCons (va_code_Cswap_single 3) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[4], p2[4]"
) (va_CCons (va_code_Cswap_single 4) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[5], p2[5]"
) (va_CCons (va_code_Cswap_single 5) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[6], p2[6]"
) (va_CCons (va_code_Cswap_single 6) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[7], p2[7]"
) (va_CCons (va_code_Cswap_single 7) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil
()))))))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap2 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Transfer bit into CF flag"
) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64
18446744073709551615)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and
(va_codegen_success_Comment
"cswap p1[0], p2[0]"
) (va_pbool_and (va_codegen_success_Cswap_single 0) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[1], p2[1]"
) (va_pbool_and (va_codegen_success_Cswap_single 1) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[2], p2[2]"
) (va_pbool_and (va_codegen_success_Cswap_single 2) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[3], p2[3]"
) (va_pbool_and (va_codegen_success_Cswap_single 3) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[4], p2[4]"
) (va_pbool_and (va_codegen_success_Cswap_single 4) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[5], p2[5]"
) (va_pbool_and (va_codegen_success_Cswap_single 5) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[6], p2[6]"
) (va_pbool_and (va_codegen_success_Cswap_single 6) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[7], p2[7]"
) (va_pbool_and (va_codegen_success_Cswap_single 7) (va_pbool_and
(va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap2 (va_mods:va_mods_t) (bit_in:nat64) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap2 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 0 (va_get_mem va_s) in
let (old_p0_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 1 (va_get_mem va_s)
in let (old_p0_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem
va_s) in let (old_p0_3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 3
(va_get_mem va_s) in let (old_p0_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
4 (va_get_mem va_s) in let (old_p0_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b 5 (va_get_mem va_s) in let (old_p0_6:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_s) in let (old_p0_7:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem va_s) in let
(old_p1_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 0 (va_get_mem va_s) in
let (old_p1_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 1 (va_get_mem va_s)
in let (old_p1_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem
va_s) in let (old_p1_3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 3
(va_get_mem va_s) in let (old_p1_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b
4 (va_get_mem va_s) in let (old_p1_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p1_b 5 (va_get_mem va_s) in let (old_p1_6:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_s) in let (old_p1_7:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 932 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 p0_b 0 Secret Mutable; declare_buffer64 p1_b 0
Secret Mutable])) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 936 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Transfer bit into CF flag"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 937 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64 18446744073709551615))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 939 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 940 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[0], p2[0]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 941 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 0 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 943 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 944 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[1], p2[1]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 945 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 1 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 947 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 948 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[2], p2[2]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 949 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 2 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 951 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 952 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[3], p2[3]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 953 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 3 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 955 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 956 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[4], p2[4]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 957 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 4 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 959 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 960 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[5], p2[5]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 961 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 5 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 963 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 964 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[6], p2[6]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 965 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 6 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 967 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 968 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[7], p2[7]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 969 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 7 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 971 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Cswap2 va_b0 va_s0 bit_in p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdi; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap2 va_mods bit_in p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap2 ()) va_qc va_s0 (fun va_s0 va_sM
va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 848 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
0 (va_get_mem va_s0) in let (old_p0_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b 1 (va_get_mem va_s0) in let (old_p0_2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem va_s0) in let (old_p0_3:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p0_b 3 (va_get_mem va_s0) in let
(old_p0_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 4 (va_get_mem va_s0) in
let (old_p0_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 5 (va_get_mem va_s0)
in let (old_p0_6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem
va_s0) in let (old_p0_7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 7
(va_get_mem va_s0) in let (old_p1_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b
0 (va_get_mem va_s0) in let (old_p1_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p1_b 1 (va_get_mem va_s0) in let (old_p1_2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem va_s0) in let (old_p1_3:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p1_b 3 (va_get_mem va_s0) in let
(old_p1_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 4 (va_get_mem va_s0) in
let (old_p1_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 5 (va_get_mem va_s0)
in let (old_p1_6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem
va_s0) in let (old_p1_7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 7
(va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 894 column 53 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_0 = Vale.X64.Decls.buffer64_read p0_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 897 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_1 = Vale.X64.Decls.buffer64_read p0_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 898 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_2 = Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 899 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_3 = Vale.X64.Decls.buffer64_read p0_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 900 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_4 = Vale.X64.Decls.buffer64_read p0_b 4 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 901 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_5 = Vale.X64.Decls.buffer64_read p0_b 5 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 902 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_6 = Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 903 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_7 = Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 905 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_0 = Vale.X64.Decls.buffer64_read p1_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 906 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_1 = Vale.X64.Decls.buffer64_read p1_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 907 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_2 = Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 908 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_3 = Vale.X64.Decls.buffer64_read p1_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 909 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_4 = Vale.X64.Decls.buffer64_read p1_b 4 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 910 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_5 = Vale.X64.Decls.buffer64_read p1_b 5 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 911 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_6 = Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 912 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_7 = Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 914 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_0 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_0) (fun _ -> old_p0_0)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 915 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_1 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_1) (fun _ -> old_p0_1)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 916 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_2 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_2) (fun _ -> old_p0_2)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 917 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_3 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_3) (fun _ -> old_p0_3)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 918 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_4 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_4) (fun _ -> old_p0_4)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 919 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_5 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_5) (fun _ -> old_p0_5)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 920 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_6 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_6) (fun _ -> old_p0_6)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 921 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_7 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_7) (fun _ -> old_p0_7)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 923 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_0 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_0) (fun _ -> old_p1_0)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 924 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_1 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_1) (fun _ -> old_p1_1)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 925 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_2 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_2) (fun _ -> old_p1_2)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 926 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_3 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_3) (fun _ -> old_p1_3)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 927 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_4 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_4) (fun _ -> old_p1_4)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 928 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_5 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_5) (fun _ -> old_p1_5)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 929 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_6 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_6) (fun _ -> old_p1_6)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 930 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_7 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_7) (fun _ ->
old_p1_7)))))))))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdi; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cswap2 bit_in p0_b p1_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cswap2 (va_code_Cswap2 ()) va_s0 bit_in p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM
(va_update_flags va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64
rR8 va_sM (va_update_reg64 rRdi va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdi; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cswap2_stdcall
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap2_stdcall win =
(va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64
rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil
())) (va_CCons (va_code_Cswap2 ()) (va_CCons (if win then va_Block (va_CCons
(va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret
(va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | win: Prims.bool -> Vale.X64.Decls.va_pbool | Prims.Tot | [
"total"
] | [] | [
"Prims.bool",
"Vale.X64.Decls.va_pbool_and",
"Vale.X64.InsStack.va_codegen_success_Push_Secret",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rRsi",
"Vale.X64.InsBasic.va_codegen_success_Mov64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool",
"Vale.Curve25519.X64.FastUtil.va_codegen_success_Cswap2",
"Vale.X64.InsStack.va_codegen_success_Pop_Secret"
] | [] | false | false | false | true | false | let va_codegen_success_Cswap2_stdcall win =
| (va_pbool_and (if win
then
va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi))
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi)
(va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi)
(va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx)
(va_op_opr64_reg64 rR8))
(va_ttrue ())))))
else va_ttrue ())
(va_pbool_and (va_codegen_success_Cswap2 ())
(va_pbool_and (if win
then
va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi))
(va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi))
(va_ttrue ()))
else va_ttrue ())
(va_ttrue ())))) | false |
Pulse.Lib.HashTable.Type.fst | Pulse.Lib.HashTable.Type.unexplode_ref | val unexplode_ref (#k:eqtype) (#v:Type0) (#ht:erased (ht_t k v))
(r:ref (ht_t k v))
(r_sz:ref pos_us)
(r_hashf:ref (k -> SZ.t))
(r_contents:ref (V.vec (cell k v)))
: stt unit
(requires exploded_vp r ht r_sz r_hashf r_contents)
(ensures fun _ -> pts_to r ht) | val unexplode_ref (#k:eqtype) (#v:Type0) (#ht:erased (ht_t k v))
(r:ref (ht_t k v))
(r_sz:ref pos_us)
(r_hashf:ref (k -> SZ.t))
(r_contents:ref (V.vec (cell k v)))
: stt unit
(requires exploded_vp r ht r_sz r_hashf r_contents)
(ensures fun _ -> pts_to r ht) | let unexplode_ref = unexplode_ref' | {
"file_name": "share/steel/examples/pulse/lib/Pulse.Lib.HashTable.Type.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 34,
"end_line": 73,
"start_col": 0,
"start_line": 73
} | (*
Copyright 2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Pulse.Lib.HashTable.Type
open Pulse.Lib.Pervasives
module V = Pulse.Lib.Vec
module R = Pulse.Lib.Reference
module SZ = FStar.SizeT
let token (#k:eqtype) (#v:Type0)
(r:ref (ht_t k v))
(r_sz:ref pos_us)
(r_hashf:ref (k -> SZ.t))
(r_contents:ref (V.vec (cell k v))) : vprop =
exists* ht. pts_to r ht
```pulse
fn explode_ref_ht_t' (#k:eqtype) (#v:Type0) (#ht:erased (ht_t k v)) (r:ref (ht_t k v))
requires pts_to r ht
returns res:(ref pos_us & ref (k -> SZ.t) & ref (V.vec (cell k v)))
ensures exploded_vp r ht (tfst res) (tsnd res) (tthd res)
{
let htc = !r;
let r_sz = R.alloc htc.sz;
let r_hashf = R.alloc htc.hashf;
let r_contents = R.alloc htc.contents;
let res = (r_sz, r_hashf, r_contents);
fold (token r r_sz r_hashf r_contents);
fold (exploded_vp r ht r_sz r_hashf r_contents);
rewrite (exploded_vp r ht r_sz r_hashf r_contents)
as (exploded_vp r ht (tfst res) (tsnd res) (tthd res));
res
}
```
let explode_ref_ht_t = explode_ref_ht_t'
```pulse
fn unexplode_ref' (#k:eqtype) (#v:Type0) (#ht:erased (ht_t k v))
(r:ref (ht_t k v))
(r_sz:ref pos_us)
(r_hashf:ref (k -> SZ.t))
(r_contents:ref (V.vec (cell k v)))
requires exploded_vp r ht r_sz r_hashf r_contents
ensures pts_to r ht
{
unfold (exploded_vp r ht r_sz r_hashf r_contents);
unfold (token r r_sz r_hashf r_contents);
let sz = !r_sz;
let hashf = !r_hashf;
let contents = !r_contents;
free r_sz; free r_hashf; free r_contents;
let s = {sz; hashf; contents};
r := s
}
``` | {
"checked_file": "/",
"dependencies": [
"Pulse.Lib.Vec.fsti.checked",
"Pulse.Lib.Reference.fsti.checked",
"Pulse.Lib.Pervasives.fst.checked",
"prims.fst.checked",
"FStar.SizeT.fsti.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Pulse.Lib.HashTable.Type.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.SizeT",
"short_module": "SZ"
},
{
"abbrev": true,
"full_module": "Pulse.Lib.Reference",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "Pulse.Lib.Vec",
"short_module": "V"
},
{
"abbrev": false,
"full_module": "Pulse.Lib.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Lib.HashTable.Spec",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.SizeT",
"short_module": "SZ"
},
{
"abbrev": true,
"full_module": "Pulse.Lib.Reference",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "Pulse.Lib.Vec",
"short_module": "V"
},
{
"abbrev": false,
"full_module": "Pulse.Lib.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Lib.HashTable",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Lib.HashTable",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
r: Pulse.Lib.Reference.ref (Pulse.Lib.HashTable.Type.ht_t k v) ->
r_sz: Pulse.Lib.Reference.ref Pulse.Lib.HashTable.Type.pos_us ->
r_hashf: Pulse.Lib.Reference.ref (_: k -> FStar.SizeT.t) ->
r_contents: Pulse.Lib.Reference.ref (Pulse.Lib.Vec.vec (Pulse.Lib.HashTable.Spec.cell k v))
-> Pulse.Lib.Core.stt Prims.unit
(Pulse.Lib.HashTable.Type.exploded_vp r (FStar.Ghost.reveal ht) r_sz r_hashf r_contents)
(fun _ -> Pulse.Lib.Reference.pts_to r (FStar.Ghost.reveal ht)) | Prims.Tot | [
"total"
] | [] | [
"Pulse.Lib.HashTable.Type.unexplode_ref'"
] | [] | false | false | false | false | false | let unexplode_ref =
| unexplode_ref' | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_quick_Fast_sub1 | val va_quick_Fast_sub1 (dst_b inA_b: buffer64) : (va_quickCode unit (va_code_Fast_sub1 ())) | val va_quick_Fast_sub1 (dst_b inA_b: buffer64) : (va_quickCode unit (va_code_Fast_sub1 ())) | let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b)) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 69,
"end_line": 902,
"start_col": 0,
"start_line": 898
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 1200,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64
-> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastUtil.va_code_Fast_sub1 ()) | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Memory.buffer64",
"Vale.X64.QuickCode.va_QProc",
"Prims.unit",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_sub1",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_Mod_mem_heaplet",
"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.rR8",
"Vale.X64.Machine_s.rRax",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"Vale.Curve25519.X64.FastUtil.va_wp_Fast_sub1",
"Vale.Curve25519.X64.FastUtil.va_wpProof_Fast_sub1",
"Vale.X64.QuickCode.va_quickCode"
] | [] | false | false | false | false | false | let va_quick_Fast_sub1 (dst_b inA_b: buffer64) : (va_quickCode unit (va_code_Fast_sub1 ())) =
| (va_QProc (va_code_Fast_sub1 ())
([
va_Mod_flags;
va_Mod_mem_heaplet 0;
va_Mod_reg64 rR11;
va_Mod_reg64 rR10;
va_Mod_reg64 rR9;
va_Mod_reg64 rR8;
va_Mod_reg64 rRax;
va_Mod_mem
])
(va_wp_Fast_sub1 dst_b inA_b)
(va_wpProof_Fast_sub1 dst_b inA_b)) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_qcode_Fast_add1_stdcall | val va_qcode_Fast_add1_stdcall
(va_mods: va_mods_t)
(win: bool)
(dst_b inA_b: buffer64)
(inB_in: nat64)
: (va_quickCode unit (va_code_Fast_add1_stdcall win)) | val va_qcode_Fast_add1_stdcall
(va_mods: va_mods_t)
(win: bool)
(dst_b inA_b: buffer64)
(inB_in: nat64)
: (va_quickCode unit (va_code_Fast_add1_stdcall win)) | let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 78,
"end_line": 563,
"start_col": 0,
"start_line": 537
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ()))))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
va_mods: Vale.X64.QuickCode.va_mods_t ->
win: Prims.bool ->
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
inB_in: Vale.X64.Memory.nat64
-> Vale.X64.QuickCode.va_quickCode Prims.unit
(Vale.Curve25519.X64.FastUtil.va_code_Fast_add1_stdcall win) | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.QuickCode.va_mods_t",
"Prims.bool",
"Vale.X64.Memory.buffer64",
"Vale.X64.Memory.nat64",
"Vale.X64.QuickCodes.qblock",
"Prims.unit",
"Prims.Cons",
"Vale.X64.Decls.va_code",
"Vale.X64.InsStack.va_code_Push_Secret",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rRsi",
"Vale.X64.QuickCodes.if_code",
"Vale.X64.QuickCodes.block",
"Vale.X64.InsBasic.va_code_Mov64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rR8",
"Prims.Nil",
"Vale.X64.Machine_s.precode",
"Vale.X64.Decls.ins",
"Vale.X64.Decls.ocmp",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_add1",
"Vale.X64.InsStack.va_code_Pop_Secret",
"Vale.X64.Decls.va_state",
"Vale.X64.QuickCodes.va_QSeq",
"Vale.X64.QuickCodes.va_range1",
"Vale.X64.InsStack.va_quick_Push_Secret",
"Vale.X64.QuickCodes.va_QBind",
"Vale.X64.QuickCodes.va_qInlineIf",
"Vale.X64.InsBasic.va_quick_Mov64",
"Vale.X64.QuickCodes.va_QEmpty",
"Vale.X64.QuickCodes.quickCodes",
"Vale.Curve25519.X64.FastUtil.va_quick_Fast_add1",
"Vale.X64.InsStack.va_quick_Pop_Secret",
"Vale.X64.Decls.va_int_range",
"Vale.X64.Decls.va_if",
"Vale.Def.Types_s.nat64",
"Prims.b2t",
"Vale.X64.Decls.va_get_reg64",
"Prims.l_not",
"Vale.X64.State.vale_state",
"Vale.X64.QuickCode.va_quickCode",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_add1_stdcall"
] | [] | false | false | false | false | false | let va_qcode_Fast_add1_stdcall
(va_mods: va_mods_t)
(win: bool)
(dst_b inA_b: buffer64)
(inB_in: nat64)
: (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
| (qblock va_mods
(fun (va_s: va_state) ->
let va_old_s:va_state = va_s in
let dst_in:(va_int_range 0 18446744073709551615) =
va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s)
in
let inA_in:(va_int_range 0 18446744073709551615) =
va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s)
in
va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi))
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi))
(fun (va_s: va_state) _ ->
va_QBind va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods
win
(qblock va_mods
(fun (va_s: va_state) ->
va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi)
(va_op_opr64_reg64 rRcx))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi)
(va_op_opr64_reg64 rRdx))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx)
(va_op_opr64_reg64 rR8))
(va_QEmpty (()))))))
(qblock va_mods (fun (va_s: va_state) -> va_QEmpty (()))))
(fun (va_s: va_state) va_g ->
va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi))
(va_QEmpty (()))))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_code_Cswap2_stdcall | val va_code_Cswap2_stdcall : win:bool -> Tot va_code | val va_code_Cswap2_stdcall : win:bool -> Tot va_code | let va_code_Cswap2_stdcall win =
(va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64
rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil
())) (va_CCons (va_code_Cswap2 ()) (va_CCons (if win then va_Block (va_CCons
(va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret
(va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 93,
"end_line": 2009,
"start_col": 0,
"start_line": 2001
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub dst_b inA_b inB_b) (va_wpProof_Fast_sub dst_b inA_b inB_b))
#pop-options
//--
//-- Cswap_single
val va_code_Cswap_single : offset:nat -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap_single offset =
(va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 +
offset `op_Multiply` 8) Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_CNil ())))))))))
val va_codegen_success_Cswap_single : offset:nat -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap_single offset =
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_ttrue ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap_single (va_mods:va_mods_t) (offset:nat) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap_single offset)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 839 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 840 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 841 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 842 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 843 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 844 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi)
(va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 845 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdx)
(va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QEmpty
(()))))))))))
val va_lemma_Cswap_single : va_b0:va_code -> va_s0:va_state -> offset:nat -> p0_b:buffer64 ->
p1_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cswap_single offset) va_s0 /\ va_get_ok va_s0 /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p1_val else old_p0_val) /\ p1_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p0_val else old_p1_val))) /\ va_state_eq va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))
[@"opaque_to_smt"]
let va_lemma_Cswap_single va_b0 va_s0 offset p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap_single va_mods offset p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap_single offset) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 792 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 821 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 822 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdx va_sM) p1_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 824 column 57 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 832 column 59 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read p0_b i
(va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet 0
va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 834 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_val = Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 835 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_val = Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 836 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ ->
old_p0_val)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 837 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ ->
old_p1_val)))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
(0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall
(va_x_mem:vale_heap) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_heap0:vale_heap) .
let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9
va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_mem va_x_mem va_s0)))) in va_get_ok va_sM /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == va_if
(Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ -> old_p0_val) /\ p1_val
== va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ -> old_p1_val)))
==> va_k va_sM (())))
val va_wpProof_Cswap_single : offset:nat -> p0_b:buffer64 -> p1_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cswap_single offset p0_b p1_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cswap_single offset)
([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Cswap_single offset p0_b p1_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cswap_single (va_code_Cswap_single offset) va_s0 offset p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))));
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) : (va_quickCode unit
(va_code_Cswap_single offset)) =
(va_QProc (va_code_Cswap_single offset) ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_mem]) (va_wp_Cswap_single offset p0_b p1_b)
(va_wpProof_Cswap_single offset p0_b p1_b))
//--
//-- Cswap2
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap2 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Transfer bit into CF flag"
) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[0], p2[0]"
) (va_CCons (va_code_Cswap_single 0) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[1], p2[1]"
) (va_CCons (va_code_Cswap_single 1) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[2], p2[2]"
) (va_CCons (va_code_Cswap_single 2) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[3], p2[3]"
) (va_CCons (va_code_Cswap_single 3) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[4], p2[4]"
) (va_CCons (va_code_Cswap_single 4) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[5], p2[5]"
) (va_CCons (va_code_Cswap_single 5) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[6], p2[6]"
) (va_CCons (va_code_Cswap_single 6) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[7], p2[7]"
) (va_CCons (va_code_Cswap_single 7) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil
()))))))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap2 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Transfer bit into CF flag"
) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64
18446744073709551615)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and
(va_codegen_success_Comment
"cswap p1[0], p2[0]"
) (va_pbool_and (va_codegen_success_Cswap_single 0) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[1], p2[1]"
) (va_pbool_and (va_codegen_success_Cswap_single 1) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[2], p2[2]"
) (va_pbool_and (va_codegen_success_Cswap_single 2) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[3], p2[3]"
) (va_pbool_and (va_codegen_success_Cswap_single 3) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[4], p2[4]"
) (va_pbool_and (va_codegen_success_Cswap_single 4) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[5], p2[5]"
) (va_pbool_and (va_codegen_success_Cswap_single 5) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[6], p2[6]"
) (va_pbool_and (va_codegen_success_Cswap_single 6) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[7], p2[7]"
) (va_pbool_and (va_codegen_success_Cswap_single 7) (va_pbool_and
(va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap2 (va_mods:va_mods_t) (bit_in:nat64) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap2 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 0 (va_get_mem va_s) in
let (old_p0_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 1 (va_get_mem va_s)
in let (old_p0_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem
va_s) in let (old_p0_3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 3
(va_get_mem va_s) in let (old_p0_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
4 (va_get_mem va_s) in let (old_p0_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b 5 (va_get_mem va_s) in let (old_p0_6:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_s) in let (old_p0_7:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem va_s) in let
(old_p1_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 0 (va_get_mem va_s) in
let (old_p1_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 1 (va_get_mem va_s)
in let (old_p1_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem
va_s) in let (old_p1_3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 3
(va_get_mem va_s) in let (old_p1_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b
4 (va_get_mem va_s) in let (old_p1_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p1_b 5 (va_get_mem va_s) in let (old_p1_6:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_s) in let (old_p1_7:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 932 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 p0_b 0 Secret Mutable; declare_buffer64 p1_b 0
Secret Mutable])) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 936 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Transfer bit into CF flag"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 937 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64 18446744073709551615))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 939 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 940 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[0], p2[0]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 941 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 0 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 943 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 944 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[1], p2[1]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 945 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 1 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 947 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 948 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[2], p2[2]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 949 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 2 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 951 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 952 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[3], p2[3]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 953 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 3 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 955 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 956 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[4], p2[4]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 957 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 4 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 959 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 960 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[5], p2[5]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 961 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 5 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 963 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 964 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[6], p2[6]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 965 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 6 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 967 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 968 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[7], p2[7]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 969 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 7 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 971 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Cswap2 va_b0 va_s0 bit_in p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdi; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap2 va_mods bit_in p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap2 ()) va_qc va_s0 (fun va_s0 va_sM
va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 848 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
0 (va_get_mem va_s0) in let (old_p0_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b 1 (va_get_mem va_s0) in let (old_p0_2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem va_s0) in let (old_p0_3:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p0_b 3 (va_get_mem va_s0) in let
(old_p0_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 4 (va_get_mem va_s0) in
let (old_p0_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 5 (va_get_mem va_s0)
in let (old_p0_6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem
va_s0) in let (old_p0_7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 7
(va_get_mem va_s0) in let (old_p1_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b
0 (va_get_mem va_s0) in let (old_p1_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p1_b 1 (va_get_mem va_s0) in let (old_p1_2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem va_s0) in let (old_p1_3:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p1_b 3 (va_get_mem va_s0) in let
(old_p1_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 4 (va_get_mem va_s0) in
let (old_p1_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 5 (va_get_mem va_s0)
in let (old_p1_6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem
va_s0) in let (old_p1_7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 7
(va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 894 column 53 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_0 = Vale.X64.Decls.buffer64_read p0_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 897 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_1 = Vale.X64.Decls.buffer64_read p0_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 898 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_2 = Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 899 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_3 = Vale.X64.Decls.buffer64_read p0_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 900 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_4 = Vale.X64.Decls.buffer64_read p0_b 4 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 901 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_5 = Vale.X64.Decls.buffer64_read p0_b 5 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 902 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_6 = Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 903 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_7 = Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 905 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_0 = Vale.X64.Decls.buffer64_read p1_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 906 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_1 = Vale.X64.Decls.buffer64_read p1_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 907 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_2 = Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 908 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_3 = Vale.X64.Decls.buffer64_read p1_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 909 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_4 = Vale.X64.Decls.buffer64_read p1_b 4 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 910 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_5 = Vale.X64.Decls.buffer64_read p1_b 5 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 911 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_6 = Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 912 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_7 = Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 914 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_0 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_0) (fun _ -> old_p0_0)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 915 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_1 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_1) (fun _ -> old_p0_1)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 916 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_2 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_2) (fun _ -> old_p0_2)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 917 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_3 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_3) (fun _ -> old_p0_3)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 918 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_4 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_4) (fun _ -> old_p0_4)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 919 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_5 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_5) (fun _ -> old_p0_5)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 920 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_6 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_6) (fun _ -> old_p0_6)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 921 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_7 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_7) (fun _ -> old_p0_7)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 923 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_0 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_0) (fun _ -> old_p1_0)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 924 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_1 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_1) (fun _ -> old_p1_1)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 925 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_2 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_2) (fun _ -> old_p1_2)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 926 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_3 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_3) (fun _ -> old_p1_3)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 927 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_4 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_4) (fun _ -> old_p1_4)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 928 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_5 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_5) (fun _ -> old_p1_5)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 929 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_6 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_6) (fun _ -> old_p1_6)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 930 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_7 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_7) (fun _ ->
old_p1_7)))))))))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdi; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cswap2 bit_in p0_b p1_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cswap2 (va_code_Cswap2 ()) va_s0 bit_in p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM
(va_update_flags va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64
rR8 va_sM (va_update_reg64 rRdi va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdi; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cswap2_stdcall | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | win: Prims.bool -> Vale.X64.Decls.va_code | Prims.Tot | [
"total"
] | [] | [
"Prims.bool",
"Vale.X64.Decls.va_Block",
"Vale.X64.Decls.va_CCons",
"Vale.X64.InsStack.va_code_Push_Secret",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rRsi",
"Vale.X64.InsBasic.va_code_Mov64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_CNil",
"Vale.X64.Decls.va_code",
"Vale.Curve25519.X64.FastUtil.va_code_Cswap2",
"Vale.X64.InsStack.va_code_Pop_Secret"
] | [] | false | false | false | true | false | let va_code_Cswap2_stdcall win =
| (va_Block (va_CCons (if win
then
va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi))
(va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi))
(va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)
)
(va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi)
(va_op_opr64_reg64 rRdx))
(va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx)
(va_op_opr64_reg64 rR8))
(va_CNil ()))))))
else va_Block (va_CNil ()))
(va_CCons (va_code_Cswap2 ())
(va_CCons (if win
then
va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi))
(va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ())))
else va_Block (va_CNil ()))
(va_CNil ()))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_qcode_Cswap2 | val va_qcode_Cswap2 (va_mods: va_mods_t) (bit_in: nat64) (p0_b p1_b: buffer64)
: (va_quickCode unit (va_code_Cswap2 ())) | val va_qcode_Cswap2 (va_mods: va_mods_t) (bit_in: nat64) (p0_b p1_b: buffer64)
: (va_quickCode unit (va_code_Cswap2 ())) | let va_qcode_Cswap2 (va_mods:va_mods_t) (bit_in:nat64) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap2 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 0 (va_get_mem va_s) in
let (old_p0_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 1 (va_get_mem va_s)
in let (old_p0_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem
va_s) in let (old_p0_3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 3
(va_get_mem va_s) in let (old_p0_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
4 (va_get_mem va_s) in let (old_p0_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b 5 (va_get_mem va_s) in let (old_p0_6:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_s) in let (old_p0_7:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem va_s) in let
(old_p1_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 0 (va_get_mem va_s) in
let (old_p1_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 1 (va_get_mem va_s)
in let (old_p1_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem
va_s) in let (old_p1_3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 3
(va_get_mem va_s) in let (old_p1_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b
4 (va_get_mem va_s) in let (old_p1_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p1_b 5 (va_get_mem va_s) in let (old_p1_6:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_s) in let (old_p1_7:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 932 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 p0_b 0 Secret Mutable; declare_buffer64 p1_b 0
Secret Mutable])) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 936 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Transfer bit into CF flag"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 937 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64 18446744073709551615))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 939 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 940 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[0], p2[0]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 941 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 0 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 943 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 944 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[1], p2[1]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 945 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 1 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 947 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 948 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[2], p2[2]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 949 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 2 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 951 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 952 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[3], p2[3]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 953 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 3 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 955 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 956 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[4], p2[4]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 957 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 4 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 959 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 960 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[5], p2[5]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 961 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 5 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 963 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 964 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[6], p2[6]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 965 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 6 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 967 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 968 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[7], p2[7]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 969 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 7 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 971 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (()))))))))))))))))))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 79,
"end_line": 1865,
"start_col": 0,
"start_line": 1769
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub dst_b inA_b inB_b) (va_wpProof_Fast_sub dst_b inA_b inB_b))
#pop-options
//--
//-- Cswap_single
val va_code_Cswap_single : offset:nat -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap_single offset =
(va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 +
offset `op_Multiply` 8) Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_CNil ())))))))))
val va_codegen_success_Cswap_single : offset:nat -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap_single offset =
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_ttrue ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap_single (va_mods:va_mods_t) (offset:nat) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap_single offset)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 839 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 840 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 841 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 842 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 843 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 844 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi)
(va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 845 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdx)
(va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QEmpty
(()))))))))))
val va_lemma_Cswap_single : va_b0:va_code -> va_s0:va_state -> offset:nat -> p0_b:buffer64 ->
p1_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cswap_single offset) va_s0 /\ va_get_ok va_s0 /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p1_val else old_p0_val) /\ p1_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p0_val else old_p1_val))) /\ va_state_eq va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))
[@"opaque_to_smt"]
let va_lemma_Cswap_single va_b0 va_s0 offset p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap_single va_mods offset p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap_single offset) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 792 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 821 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 822 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdx va_sM) p1_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 824 column 57 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 832 column 59 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read p0_b i
(va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet 0
va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 834 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_val = Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 835 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_val = Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 836 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ ->
old_p0_val)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 837 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ ->
old_p1_val)))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
(0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall
(va_x_mem:vale_heap) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_heap0:vale_heap) .
let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9
va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_mem va_x_mem va_s0)))) in va_get_ok va_sM /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == va_if
(Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ -> old_p0_val) /\ p1_val
== va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ -> old_p1_val)))
==> va_k va_sM (())))
val va_wpProof_Cswap_single : offset:nat -> p0_b:buffer64 -> p1_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cswap_single offset p0_b p1_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cswap_single offset)
([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Cswap_single offset p0_b p1_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cswap_single (va_code_Cswap_single offset) va_s0 offset p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))));
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) : (va_quickCode unit
(va_code_Cswap_single offset)) =
(va_QProc (va_code_Cswap_single offset) ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_mem]) (va_wp_Cswap_single offset p0_b p1_b)
(va_wpProof_Cswap_single offset p0_b p1_b))
//--
//-- Cswap2
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap2 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Transfer bit into CF flag"
) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[0], p2[0]"
) (va_CCons (va_code_Cswap_single 0) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[1], p2[1]"
) (va_CCons (va_code_Cswap_single 1) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[2], p2[2]"
) (va_CCons (va_code_Cswap_single 2) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[3], p2[3]"
) (va_CCons (va_code_Cswap_single 3) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[4], p2[4]"
) (va_CCons (va_code_Cswap_single 4) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[5], p2[5]"
) (va_CCons (va_code_Cswap_single 5) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[6], p2[6]"
) (va_CCons (va_code_Cswap_single 6) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[7], p2[7]"
) (va_CCons (va_code_Cswap_single 7) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil
()))))))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap2 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Transfer bit into CF flag"
) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64
18446744073709551615)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and
(va_codegen_success_Comment
"cswap p1[0], p2[0]"
) (va_pbool_and (va_codegen_success_Cswap_single 0) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[1], p2[1]"
) (va_pbool_and (va_codegen_success_Cswap_single 1) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[2], p2[2]"
) (va_pbool_and (va_codegen_success_Cswap_single 2) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[3], p2[3]"
) (va_pbool_and (va_codegen_success_Cswap_single 3) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[4], p2[4]"
) (va_pbool_and (va_codegen_success_Cswap_single 4) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[5], p2[5]"
) (va_pbool_and (va_codegen_success_Cswap_single 5) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[6], p2[6]"
) (va_pbool_and (va_codegen_success_Cswap_single 6) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[7], p2[7]"
) (va_pbool_and (va_codegen_success_Cswap_single 7) (va_pbool_and
(va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))))))))))))))))))))))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
va_mods: Vale.X64.QuickCode.va_mods_t ->
bit_in: Vale.X64.Memory.nat64 ->
p0_b: Vale.X64.Memory.buffer64 ->
p1_b: Vale.X64.Memory.buffer64
-> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastUtil.va_code_Cswap2 ()) | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.QuickCode.va_mods_t",
"Vale.X64.Memory.nat64",
"Vale.X64.Memory.buffer64",
"Vale.X64.QuickCodes.qblock",
"Prims.unit",
"Prims.Cons",
"Vale.X64.Decls.va_code",
"Vale.X64.InsMem.va_code_CreateHeaplets",
"Vale.X64.InsBasic.va_code_Comment",
"Vale.X64.InsBasic.va_code_Add64Wrap",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Decls.va_const_opr64",
"Vale.X64.InsBasic.va_code_Newline",
"Vale.Curve25519.X64.FastUtil.va_code_Cswap_single",
"Vale.X64.InsMem.va_code_DestroyHeaplets",
"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.InsMem.va_quick_CreateHeaplets",
"Vale.Arch.HeapImpl.buffer_info",
"Vale.X64.InsMem.declare_buffer64",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.Arch.HeapImpl.Mutable",
"Vale.X64.InsBasic.va_quick_Comment",
"Vale.X64.InsBasic.va_quick_Add64Wrap",
"Vale.X64.InsBasic.va_quick_Newline",
"Vale.Curve25519.X64.FastUtil.va_quick_Cswap_single",
"Vale.X64.InsMem.va_quick_DestroyHeaplets",
"Vale.X64.QuickCodes.va_QEmpty",
"Vale.Def.Words_s.nat64",
"Vale.X64.Decls.buffer64_read",
"Vale.X64.Decls.va_get_mem",
"Vale.X64.State.vale_state",
"Vale.X64.QuickCodes.quickCodes",
"Vale.X64.QuickCode.va_quickCode",
"Vale.Curve25519.X64.FastUtil.va_code_Cswap2"
] | [] | false | false | false | false | false | let va_qcode_Cswap2 (va_mods: va_mods_t) (bit_in: nat64) (p0_b p1_b: buffer64)
: (va_quickCode unit (va_code_Cswap2 ())) =
| (qblock va_mods
(fun (va_s: va_state) ->
let va_old_s:va_state = va_s in
let old_p0_0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b 0 (va_get_mem va_s)
in
let old_p0_1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b 1 (va_get_mem va_s)
in
let old_p0_2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem va_s)
in
let old_p0_3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b 3 (va_get_mem va_s)
in
let old_p0_4:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b 4 (va_get_mem va_s)
in
let old_p0_5:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b 5 (va_get_mem va_s)
in
let old_p0_6:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_s)
in
let old_p0_7:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem va_s)
in
let old_p1_0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b 0 (va_get_mem va_s)
in
let old_p1_1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b 1 (va_get_mem va_s)
in
let old_p1_2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem va_s)
in
let old_p1_3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b 3 (va_get_mem va_s)
in
let old_p1_4:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b 4 (va_get_mem va_s)
in
let old_p1_5:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b 5 (va_get_mem va_s)
in
let old_p1_6:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_s)
in
let old_p1_7:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem va_s)
in
va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 932 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([
declare_buffer64 p0_b 0 Secret Mutable;
declare_buffer64 p1_b 0 Secret Mutable
]))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 936 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment "Transfer bit into CF flag")
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 937 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdi)
(va_const_opr64 18446744073709551615))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 939 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ())
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 940 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment "cswap p1[0], p2[0]")
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 941 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 0 p0_b p1_b)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 943 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ())
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 944 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment "cswap p1[1], p2[1]")
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 945 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 1 p0_b p1_b)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 947 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ())
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 948 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment "cswap p1[2], p2[2]")
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 949 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 2 p0_b p1_b)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 951 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ())
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 952 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment "cswap p1[3], p2[3]"
)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 953 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 3 p0_b p1_b
)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 955 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ())
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 956 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment "cswap p1[4], p2[4]"
)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 957 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single
4
p0_b
p1_b)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 959 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()
)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 960 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[5], p2[5]"
)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 961 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single
5
p0_b
p1_b)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 963 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline
()
)
(va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 964 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[6], p2[6]"
)
(va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 965 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(
va_quick_Cswap_single
6
p0_b
p1_b
)
(
va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 967 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(
va_quick_Newline
()
)
(
va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 968 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(
va_quick_Comment
"cswap p1[7], p2[7]"
)
(
va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 969 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(
va_quick_Cswap_single
7
p0_b
p1_b
)
(
va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 971 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(
va_quick_DestroyHeaplets
()
)
(
va_QEmpty
(
()
)
)
)
)
)
)
))
))))))))))
))))))))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_quick_Fast_add | val va_quick_Fast_add (dst_b inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fast_add ())) | val va_quick_Fast_add (dst_b inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fast_add ())) | let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b)) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 92,
"end_line": 1206,
"start_col": 0,
"start_line": 1202
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
inB_b: Vale.X64.Memory.buffer64
-> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastUtil.va_code_Fast_add ()) | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Memory.buffer64",
"Vale.X64.QuickCode.va_QProc",
"Prims.unit",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_add",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_Mod_mem_heaplet",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Machine_s.rRax",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"Vale.Curve25519.X64.FastUtil.va_wp_Fast_add",
"Vale.Curve25519.X64.FastUtil.va_wpProof_Fast_add",
"Vale.X64.QuickCode.va_quickCode"
] | [] | false | false | false | false | false | let va_quick_Fast_add (dst_b inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fast_add ())) =
| (va_QProc (va_code_Fast_add ())
([
va_Mod_flags;
va_Mod_mem_heaplet 0;
va_Mod_reg64 rRbx;
va_Mod_reg64 rR11;
va_Mod_reg64 rR10;
va_Mod_reg64 rR9;
va_Mod_reg64 rR8;
va_Mod_reg64 rRax;
va_Mod_mem
])
(va_wp_Fast_add dst_b inA_b inB_b)
(va_wpProof_Fast_add dst_b inA_b inB_b)) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_qcode_Fast_sub1 | val va_qcode_Fast_sub1 (va_mods: va_mods_t) (dst_b inA_b: buffer64)
: (va_quickCode unit (va_code_Fast_sub1 ())) | val va_qcode_Fast_sub1 (va_mods: va_mods_t) (dst_b inA_b: buffer64)
: (va_quickCode unit (va_code_Fast_sub1 ())) | let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(()))))))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 26,
"end_line": 770,
"start_col": 0,
"start_line": 719
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ()))))))))))))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 1200,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
va_mods: Vale.X64.QuickCode.va_mods_t ->
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64
-> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastUtil.va_code_Fast_sub1 ()) | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.QuickCode.va_mods_t",
"Vale.X64.Memory.buffer64",
"Vale.X64.QuickCodes.qblock",
"Prims.unit",
"Prims.Cons",
"Vale.X64.Decls.va_code",
"Vale.X64.InsBasic.va_code_Xor64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.InsMem.va_code_Load64_buffer",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRsi",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.InsBasic.va_code_Sub64Wrap",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.InsMem.va_code_Store64_buffer",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rR9",
"Vale.X64.InsBasic.va_code_Sbb64",
"Vale.X64.Decls.va_const_opr64",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR11",
"Vale.X64.InsBasic.va_code_Adc64Wrap",
"Prims.Nil",
"Vale.X64.Machine_s.precode",
"Vale.X64.Decls.ins",
"Vale.X64.Decls.ocmp",
"Vale.X64.Decls.va_state",
"Vale.X64.QuickCodes.va_qPURE",
"Prims.pure_post",
"Prims.l_and",
"Prims.l_True",
"Prims.l_Forall",
"Prims.l_imp",
"Vale.Def.Words_s.nat32",
"Prims.eq2",
"Vale.Def.Types_s.ixor",
"Prims.int",
"Vale.Def.Words_s.nat64",
"Vale.X64.QuickCodes.va_range1",
"Vale.Arch.Types.xor_lemmas",
"Vale.X64.QuickCodes.va_QSeq",
"Vale.X64.InsBasic.va_quick_Xor64",
"Vale.X64.InsMem.va_quick_Load64_buffer",
"Vale.X64.InsBasic.va_quick_Sub64Wrap",
"Vale.X64.InsMem.va_quick_Store64_buffer",
"Vale.X64.InsBasic.va_quick_Sbb64",
"Vale.X64.QuickCodes.va_QBind",
"Vale.X64.InsBasic.va_quick_Adc64Wrap",
"Vale.X64.QuickCodes.va_qAssert",
"Prims.nat",
"Prims.l_or",
"Prims.b2t",
"Prims.op_LessThan",
"Vale.Def.Words_s.pow2_64",
"Prims.op_LessThanOrEqual",
"Vale.X64.Decls.va_get_reg64",
"Vale.Curve25519.Fast_defs.bool_bit",
"Vale.X64.QuickCodes.va_QEmpty",
"Vale.X64.QuickCodes.quickCodes",
"Prims.bool",
"Vale.X64.Decls.cf",
"Vale.X64.Decls.va_get_flags",
"Vale.Curve25519.Fast_defs.pow2_four",
"Vale.X64.Decls.buffer64_read",
"Vale.X64.Decls.va_get_mem_heaplet",
"Vale.X64.State.vale_state",
"Vale.X64.QuickCode.va_quickCode",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_sub1"
] | [] | false | false | false | false | false | let va_qcode_Fast_sub1 (va_mods: va_mods_t) (dst_b inA_b: buffer64)
: (va_quickCode unit (va_code_Fast_sub1 ())) =
| (qblock va_mods
(fun (va_s: va_state) ->
let va_old_s:va_state = va_s in
let a0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in
let a1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s)
in
let a2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s)
in
let a3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s)
in
let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_: unit) -> Vale.Arch.Types.xor_lemmas ())
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi)
0
Secret
inA_b
0)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8)
0
Secret
dst_b
0)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi)
8
Secret
inA_b
1)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9)
8
Secret
dst_b
1)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi)
16
Secret
inA_b
2)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10)
16
Secret
dst_b
2)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi)
24
Secret
inA_b
3)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11
)
(va_const_opr64 0))
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11)
24
Secret
dst_b
3)
(fun (va_s: va_state) _ ->
let c:bool =
Vale.X64.Decls.cf (va_get_flags va_s
)
in
va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64
rRax)
(va_op_opr64_reg64 rRax))
(fun (va_s: va_state) _ ->
va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s ==
Vale.Curve25519.Fast_defs.bool_bit
c)
(va_QEmpty (()))))))))))))
))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_wpProof_Fast_add | val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) | val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) | let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 22,
"end_line": 1199,
"start_col": 0,
"start_line": 1188
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
inB_b: Vale.X64.Memory.buffer64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | Prims.Ghost | [] | [] | [
"Vale.X64.Memory.buffer64",
"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_mem_heaplet",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Machine_s.rRax",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_mem_heaplet",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_mem",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.Curve25519.X64.FastUtil.va_lemma_Fast_add",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_add"
] | [] | false | false | false | false | false | let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
| let va_sM, va_f0 = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM
(va_update_mem_heaplet 0
va_sM
(va_update_reg64 rRbx
va_sM
(va_update_reg64 rR11
va_sM
(va_update_reg64 rR10
va_sM
(va_update_reg64 rR9
va_sM
(va_update_reg64 rR8
va_sM
(va_update_reg64 rRax
va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))));
va_lemma_norm_mods ([
va_Mod_flags;
va_Mod_mem_heaplet 0;
va_Mod_reg64 rRbx;
va_Mod_reg64 rR11;
va_Mod_reg64 rR10;
va_Mod_reg64 rR9;
va_Mod_reg64 rR8;
va_Mod_reg64 rRax;
va_Mod_mem
])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_wpProof_Fast_add1_stdcall | val va_wpProof_Fast_add1_stdcall : win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> inB_in:nat64 ->
va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add1_stdcall win)
([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags;
va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi;
va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax;
va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) | val va_wpProof_Fast_add1_stdcall : win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> inB_in:nat64 ->
va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add1_stdcall win)
([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags;
va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi;
va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax;
va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) | let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 22,
"end_line": 663,
"start_col": 0,
"start_line": 645
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
win: Prims.bool ->
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
inB_in: Vale.X64.Memory.nat64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | Prims.Ghost | [] | [] | [
"Prims.bool",
"Vale.X64.Memory.buffer64",
"Vale.X64.Memory.nat64",
"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_stackTaint",
"Vale.X64.QuickCode.va_Mod_stack",
"Vale.X64.QuickCode.va_Mod_mem_layout",
"Vale.X64.QuickCode.va_Mod_mem_heaplet",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rR15",
"Vale.X64.Machine_s.rR14",
"Vale.X64.Machine_s.rR13",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Machine_s.rRsp",
"Vale.X64.Machine_s.rRbp",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rRsi",
"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_mem",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_stackTaint",
"Vale.X64.Decls.va_update_stack",
"Vale.X64.Decls.va_update_mem_layout",
"Vale.X64.Decls.va_update_mem_heaplet",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_mem",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.Curve25519.X64.FastUtil.va_lemma_Fast_add1_stdcall",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_add1_stdcall"
] | [] | false | false | false | false | false | let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
| let va_sM, va_f0 =
va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b inA_b inB_in
in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_stackTaint va_sM
(va_update_stack va_sM
(va_update_mem_layout va_sM
(va_update_mem_heaplet 0
va_sM
(va_update_flags va_sM
(va_update_reg64 rR15
va_sM
(va_update_reg64 rR14
va_sM
(va_update_reg64 rR13
va_sM
(va_update_reg64 rR11
va_sM
(va_update_reg64 rR10
va_sM
(va_update_reg64 rR9
va_sM
(va_update_reg64 rR8
va_sM
(va_update_reg64 rRsp
va_sM
(va_update_reg64 rRbp
va_sM
(va_update_reg64 rRdi
va_sM
(va_update_reg64 rRsi
va_sM
(va_update_reg64 rRdx
va_sM
(va_update_reg64 rRcx
va_sM
(va_update_reg64 rRbx
va_sM
(va_update_reg64 rRax
va_sM
(va_update_ok va_sM
(va_update_mem
va_sM
va_s0)
))))))))))))))
))))))));
va_lemma_norm_mods ([
va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags;
va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi;
va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax;
va_Mod_mem
])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_wpProof_Fast_sub1 | val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) | val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) | let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 22,
"end_line": 895,
"start_col": 0,
"start_line": 886
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 1200,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | Prims.Ghost | [] | [] | [
"Vale.X64.Memory.buffer64",
"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_mem_heaplet",
"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.rR8",
"Vale.X64.Machine_s.rRax",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_mem_heaplet",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_mem",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.Curve25519.X64.FastUtil.va_lemma_Fast_sub1",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_sub1"
] | [] | false | false | false | false | false | let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
| let va_sM, va_f0 = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM
(va_update_mem_heaplet 0
va_sM
(va_update_reg64 rR11
va_sM
(va_update_reg64 rR10
va_sM
(va_update_reg64 rR9
va_sM
(va_update_reg64 rR8
va_sM
(va_update_reg64 rRax
va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([
va_Mod_flags;
va_Mod_mem_heaplet 0;
va_Mod_reg64 rR11;
va_Mod_reg64 rR10;
va_Mod_reg64 rR9;
va_Mod_reg64 rR8;
va_Mod_reg64 rRax;
va_Mod_mem
])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_qcode_Fast_add1 | val va_qcode_Fast_add1 (va_mods: va_mods_t) (dst_b inA_b: buffer64) (inB: nat64)
: (va_quickCode unit (va_code_Fast_add1 ())) | val va_qcode_Fast_add1 (va_mods: va_mods_t) (dst_b inA_b: buffer64) (inB: nat64)
: (va_quickCode unit (va_code_Fast_add1 ())) | let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (()))))))))))))))))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 77,
"end_line": 455,
"start_col": 0,
"start_line": 377
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
())))))))))))))))))))))))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
va_mods: Vale.X64.QuickCode.va_mods_t ->
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
inB: Vale.X64.Memory.nat64
-> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastUtil.va_code_Fast_add1 ()) | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.QuickCode.va_mods_t",
"Vale.X64.Memory.buffer64",
"Vale.X64.Memory.nat64",
"Vale.X64.QuickCodes.qblock",
"Prims.unit",
"Prims.Cons",
"Vale.X64.Decls.va_code",
"Vale.X64.InsMem.va_code_CreateHeaplets",
"Vale.X64.InsBasic.va_code_Comment",
"Vale.X64.InsBasic.va_code_Xor64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rRax",
"Vale.X64.InsBasic.va_code_Newline",
"Vale.X64.InsMem.va_code_Mem64_lemma",
"Vale.X64.InsBasic.va_code_Add64Wrap",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Decls.va_opr_code_Mem64",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Decls.va_op_reg64_reg64",
"Vale.X64.Machine_s.rRsi",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.InsMem.va_code_Store64_buffer",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.InsBasic.va_code_Adcx64Wrap",
"Vale.X64.InsMem.va_code_DestroyHeaplets",
"Prims.Nil",
"Vale.X64.Machine_s.precode",
"Vale.X64.Decls.ins",
"Vale.X64.Decls.ocmp",
"Vale.X64.Decls.va_state",
"Vale.X64.QuickCodes.va_QBind",
"Vale.X64.QuickCodes.va_range1",
"Vale.X64.InsMem.va_quick_CreateHeaplets",
"Vale.Arch.HeapImpl.buffer_info",
"Vale.X64.InsMem.declare_buffer64",
"Vale.Arch.HeapImpl.Immutable",
"Vale.Arch.HeapImpl.Mutable",
"Vale.X64.QuickCodes.va_qPURE",
"Prims.pure_post",
"Prims.l_and",
"Prims.l_True",
"Prims.l_Forall",
"Prims.l_imp",
"Vale.Def.Words_s.nat32",
"Prims.eq2",
"Vale.Def.Types_s.ixor",
"Prims.int",
"Vale.Def.Words_s.nat64",
"Vale.Arch.Types.xor_lemmas",
"Vale.X64.QuickCodes.va_QSeq",
"Vale.X64.InsBasic.va_quick_Comment",
"Vale.X64.InsBasic.va_quick_Xor64",
"Vale.X64.InsBasic.va_quick_Newline",
"Vale.X64.InsMem.va_quick_Mem64_lemma",
"Vale.X64.InsBasic.va_quick_Add64Wrap",
"Vale.X64.InsMem.va_quick_Store64_buffer",
"Vale.X64.InsBasic.va_quick_Adcx64Wrap",
"Vale.X64.InsMem.va_quick_DestroyHeaplets",
"Vale.X64.QuickCodes.va_QEmpty",
"Vale.X64.QuickCodes.quickCodes",
"Prims.nat",
"Vale.Curve25519.Fast_defs.pow2_four",
"Vale.X64.Decls.buffer64_read",
"Vale.X64.Decls.va_get_mem",
"Vale.X64.State.vale_state",
"Vale.X64.QuickCode.va_quickCode",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_add1"
] | [] | false | false | false | false | false | let va_qcode_Fast_add1 (va_mods: va_mods_t) (dst_b inA_b: buffer64) (inB: nat64)
: (va_quickCode unit (va_code_Fast_add1 ())) =
| (qblock va_mods
(fun (va_s: va_state) ->
let va_old_s:va_state = va_s in
let a0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in
let a1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in
let a2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in
let a3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in
let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([
declare_buffer64 inA_b 0 Secret Immutable;
declare_buffer64 dst_b 0 Secret Mutable
]))
(fun (va_s: va_state) _ ->
va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_: unit) -> Vale.Arch.Types.xor_lemmas ())
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment "Clear registers to propagate the carry bit")
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR10))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11)
(va_op_opr64_reg64 rR11))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax)
(va_op_opr64_reg64 rRax))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ())
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment "Begin addition chain")
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi)
0
inA_b
0
Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx
)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi)
0
Secret))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx)
0
Secret
dst_b
0)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi)
8
inA_b
1
Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64
rR8)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi)
8
Secret))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi
)
(va_op_reg_opr64_reg64 rR8
)
8
Secret
dst_b
1)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi
)
16
inA_b
2
Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap
(va_op_dst_opr64_reg64
rR9)
(va_opr_code_Mem64
(va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64
rRsi)
16
Secret))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer
(va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64
rRdi)
(va_op_reg_opr64_reg64
rR9)
16
Secret
dst_b
2)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma
(va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64
rRsi
)
24
inA_b
3
Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap
(va_op_dst_opr64_reg64
rR10
)
(va_opr_code_Mem64
(
va_op_heaplet_mem_heaplet
0
)
(
va_op_reg64_reg64
rRsi
)
24
Secret
))
(va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer
(
va_op_heaplet_mem_heaplet
0
)
(
va_op_reg_opr64_reg64
rRdi
)
(
va_op_reg_opr64_reg64
rR10
)
24
Secret
dst_b
3
)
(va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(
va_quick_Newline
()
)
(
va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(
va_quick_Comment
"Return the carry bit in a register"
)
(
va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(
va_quick_Adcx64Wrap
(
va_op_dst_opr64_reg64
rRax
)
(
va_op_opr64_reg64
rR11
)
)
(
va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(
va_quick_DestroyHeaplets
()
)
(
va_QEmpty
(
()
)
)
)
)
)
))
))))))))))))
)))))))))) | false |
Steel.Channel.Simplex.fst | Steel.Channel.Simplex.update_trace | val update_trace (#p: _) (r: trace_ref p) (vr vs: chan_val)
: Steel unit
(trace_until r vr)
(fun _ -> trace_until r vs)
(requires fun _ -> chan_inv_step_p vr vs)
(ensures fun _ _ _ -> True) | val update_trace (#p: _) (r: trace_ref p) (vr vs: chan_val)
: Steel unit
(trace_until r vr)
(fun _ -> trace_until r vs)
(requires fun _ -> chan_inv_step_p vr vs)
(ensures fun _ _ _ -> True) | let update_trace #p (r:trace_ref p) (vr:chan_val) (vs:chan_val)
: Steel unit
(trace_until r vr)
(fun _ -> trace_until r vs)
(requires fun _ -> chan_inv_step_p vr vs)
(ensures fun _ _ _ -> True)
= intro_pure (chan_inv_step_p vr vs);
let tr = MRef.read_refine r in
elim_pure (until tr == step vr.chan_prot vr.chan_msg);
let ts : extension_of tr = next_trace_st vr vs tr in
MRef.write r ts;
intro_pure (until ts == step vs.chan_prot vs.chan_msg);
intro_exists ts
(fun (ts:partial_trace_of p) ->
MRef.pts_to r full_perm ts `star`
pure (until ts == step vs.chan_prot vs.chan_msg)) | {
"file_name": "lib/steel/Steel.Channel.Simplex.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 58,
"end_line": 332,
"start_col": 0,
"start_line": 317
} | (*
Copyright 2020 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 Steel.Channel.Simplex
module P = Steel.Channel.Protocol
open Steel.SpinLock
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.HigherReference
open Steel.FractionalPermission
module MRef = Steel.MonotonicHigherReference
module H = Steel.HigherReference
let sprot = p:prot { more p }
noeq
type chan_val = {
chan_prot : sprot;
chan_msg : msg_t chan_prot;
chan_ctr : nat
}
let mref a p = MRef.ref a p
let trace_ref (p:prot) = mref (partial_trace_of p) extended_to
noeq
type chan_t (p:prot) = {
send: ref chan_val;
recv: ref chan_val;
trace: trace_ref p;
}
let half : perm = half_perm full_perm
let step (s:sprot) (x:msg_t s) = step s x
let chan_inv_step_p (vrecv vsend:chan_val) : prop =
(vsend.chan_prot == step vrecv.chan_prot vrecv.chan_msg /\
vsend.chan_ctr == vrecv.chan_ctr + 1)
let chan_inv_step (vrecv vsend:chan_val) : vprop =
pure (chan_inv_step_p vrecv vsend)
let chan_inv_cond (vsend:chan_val) (vrecv:chan_val) : vprop =
if vsend.chan_ctr = vrecv.chan_ctr
then pure (vsend == vrecv)
else chan_inv_step vrecv vsend
let trace_until_prop #p (r:trace_ref p) (vr:chan_val) (tr: partial_trace_of p) : vprop =
MRef.pts_to r full_perm tr `star`
pure (until tr == step vr.chan_prot vr.chan_msg)
let trace_until #p (r:trace_ref p) (vr:chan_val) =
h_exists (trace_until_prop r vr)
let chan_inv_recv #p (c:chan_t p) (vsend:chan_val) =
h_exists (fun (vrecv:chan_val) ->
pts_to c.recv half vrecv `star`
trace_until c.trace vrecv `star`
chan_inv_cond vsend vrecv)
let chan_inv #p (c:chan_t p) : vprop =
h_exists (fun (vsend:chan_val) ->
pts_to c.send half vsend `star` chan_inv_recv c vsend)
let intro_chan_inv_cond_eqT (vs vr:chan_val)
: Steel unit emp
(fun _ -> chan_inv_cond vs vr)
(requires fun _ -> vs == vr)
(ensures fun _ _ _ -> True)
= intro_pure (vs == vs);
rewrite_slprop (chan_inv_cond vs vs) (chan_inv_cond vs vr) (fun _ -> ())
let intro_chan_inv_cond_stepT (vs vr:chan_val)
: SteelT unit (chan_inv_step vr vs)
(fun _ -> chan_inv_cond vs vr)
= Steel.Utils.extract_pure (chan_inv_step_p vr vs);
rewrite_slprop (chan_inv_step vr vs) (chan_inv_cond vs vr) (fun _ -> ())
let intro_chan_inv_auxT #p (#vs : chan_val)
(#vr : chan_val)
(c:chan_t p)
: SteelT unit (pts_to c.send half vs `star`
pts_to c.recv half vr `star`
trace_until c.trace vr `star`
chan_inv_cond vs vr)
(fun _ -> chan_inv c)
= intro_exists _ (fun (vr:chan_val) -> pts_to c.recv half vr `star` trace_until c.trace vr `star` chan_inv_cond vs vr);
intro_exists _ (fun (vs:chan_val) -> pts_to c.send half vs `star` chan_inv_recv c vs)
let intro_chan_inv_stepT #p (c:chan_t p) (vs vr:chan_val)
: SteelT unit (pts_to c.send half vs `star`
pts_to c.recv half vr `star`
trace_until c.trace vr `star`
chan_inv_step vr vs)
(fun _ -> chan_inv c)
= intro_chan_inv_cond_stepT vs vr;
intro_chan_inv_auxT c
let intro_chan_inv_eqT #p (c:chan_t p) (vs vr:chan_val)
: Steel unit (pts_to c.send half vs `star`
pts_to c.recv half vr `star`
trace_until c.trace vr)
(fun _ -> chan_inv c)
(requires fun _ -> vs == vr)
(ensures fun _ _ _ -> True)
= intro_chan_inv_cond_eqT vs vr;
intro_chan_inv_auxT c
noeq
type chan p = {
chan_chan : chan_t p;
chan_lock : lock (chan_inv chan_chan)
}
let in_state_prop (p:prot) (vsend:chan_val) : prop =
p == step vsend.chan_prot vsend.chan_msg
irreducible
let next_chan_val (#p:sprot) (x:msg_t p) (vs0:chan_val { in_state_prop p vs0 })
: Tot (vs:chan_val{in_state_prop (step p x) vs /\ chan_inv_step_p vs0 vs})
= {
chan_prot = (step vs0.chan_prot vs0.chan_msg);
chan_msg = x;
chan_ctr = vs0.chan_ctr + 1
}
[@@__reduce__]
let in_state_slprop (p:prot) (vsend:chan_val) : vprop = pure (in_state_prop p vsend)
let in_state (r:ref chan_val) (p:prot) =
h_exists (fun (vsend:chan_val) ->
pts_to r half vsend `star` in_state_slprop p vsend)
let sender #q (c:chan q) (p:prot) = in_state c.chan_chan.send p
let receiver #q (c:chan q) (p:prot) = in_state c.chan_chan.recv p
let intro_chan_inv #p (c:chan_t p) (v:chan_val)
: SteelT unit (pts_to c.send half v `star`
pts_to c.recv half v `star`
trace_until c.trace v)
(fun _ -> chan_inv c)
= intro_chan_inv_eqT c v v
let chan_val_p (p:prot) = (vs0:chan_val { in_state_prop p vs0 })
let intro_in_state (r:ref chan_val) (p:prot) (v:chan_val_p p)
: SteelT unit (pts_to r half v) (fun _ -> in_state r p)
= intro_pure (in_state_prop p v);
intro_exists v (fun (v:chan_val) -> pts_to r half v `star` in_state_slprop p v)
let msg t p = Msg Send unit (fun _ -> p)
let init_chan_val (p:prot) = v:chan_val {v.chan_prot == msg unit p}
let initial_trace (p:prot) : (q:partial_trace_of p {until q == p})
= { to = p; tr=Waiting p}
let intro_trace_until #q (r:trace_ref q) (tr:partial_trace_of q) (v:chan_val)
: Steel unit (MRef.pts_to r full_perm tr)
(fun _ -> trace_until r v)
(requires fun _ -> until tr == step v.chan_prot v.chan_msg)
(ensures fun _ _ _ -> True)
= intro_pure (until tr == step v.chan_prot v.chan_msg);
intro_exists tr
(fun (tr:partial_trace_of q) ->
MRef.pts_to r full_perm tr `star`
pure (until tr == (step v.chan_prot v.chan_msg)));
()
let chan_t_sr (p:prot) (send recv:ref chan_val) = (c:chan_t p{c.send == send /\ c.recv == recv})
let intro_trace_until_init #p (c:chan_t p) (v:init_chan_val p)
: SteelT unit (MRef.pts_to c.trace full_perm (initial_trace p))
(fun _ -> trace_until c.trace v)
= intro_pure (until (initial_trace p) == step v.chan_prot v.chan_msg);
//TODO: Not sure why I need this rewrite
rewrite_slprop (MRef.pts_to c.trace full_perm (initial_trace p) `star`
pure (until (initial_trace p) == step v.chan_prot v.chan_msg))
(MRef.pts_to c.trace full_perm (initial_trace p) `star`
pure (until (initial_trace p) == step v.chan_prot v.chan_msg))
(fun _ -> ());
intro_exists (initial_trace p) (trace_until_prop c.trace v)
let mk_chan (#p:prot) (send recv:ref chan_val) (v:init_chan_val p)
: SteelT (chan_t_sr p send recv)
(pts_to send half v `star` pts_to recv half v)
(fun c -> chan_inv c)
= let tr: trace_ref p = MRef.alloc (extended_to #p) (initial_trace p) in
let c = Mkchan_t send recv tr in
rewrite_slprop
(MRef.pts_to tr full_perm (initial_trace p))
(MRef.pts_to c.trace full_perm (initial_trace p)) (fun _ -> ());
intro_trace_until_init c v;
rewrite_slprop
(pts_to send half v `star` pts_to recv half v)
(pts_to c.send half v `star` pts_to c.recv half v)
(fun _ -> ());
intro_chan_inv #p c v;
let c' : chan_t_sr p send recv = c in
rewrite_slprop (chan_inv c) (chan_inv c') (fun _ -> ());
return c'
let new_chan (p:prot) : SteelT (chan p) emp (fun c -> sender c p `star` receiver c p)
= let q = msg unit p in
let v : chan_val = { chan_prot = q; chan_msg = (); chan_ctr = 0 } in
let vp : init_chan_val p = v in
let send = H.alloc v in
let recv = H.alloc v in
H.share recv;
H.share send;
(* TODO: use smt_fallback *)
rewrite_slprop (pts_to send (half_perm full_perm) v `star`
pts_to send (half_perm full_perm) v `star`
pts_to recv (half_perm full_perm) v `star`
pts_to recv (half_perm full_perm) v)
(pts_to send half vp `star`
pts_to send half vp `star`
pts_to recv half vp `star`
pts_to recv half vp)
(fun _ -> ());
let c = mk_chan send recv vp in
intro_in_state send p vp;
intro_in_state recv p vp;
let l = Steel.SpinLock.new_lock (chan_inv c) in
let ch = { chan_chan = c; chan_lock = l } in
rewrite_slprop (in_state send p) (sender ch p) (fun _ -> ());
rewrite_slprop (in_state recv p) (receiver ch p) (fun _ -> ());
return ch
[@@__reduce__]
let send_recv_in_sync (r:ref chan_val) (p:prot{more p}) #q (c:chan_t q) (vs vr:chan_val) : vprop =
(pts_to c.send half vs `star`
pts_to c.recv half vr `star`
trace_until c.trace vr `star`
pure (vs == vr) `star`
in_state r p)
[@@__reduce__]
let sender_ahead (r:ref chan_val) (p:prot{more p}) #q (c:chan_t q) (vs vr:chan_val) : vprop =
(pts_to c.send half vs `star`
pts_to c.recv half vr `star`
trace_until c.trace vr `star`
chan_inv_step vr vs `star`
in_state r p)
let update_channel (#p:sprot) #q (c:chan_t q) (x:msg_t p) (vs:chan_val) (r:ref chan_val)
: SteelT chan_val
(pts_to r full_perm vs `star` in_state_slprop p vs)
(fun vs' -> pts_to r full_perm vs' `star` (in_state_slprop (step p x) vs' `star` chan_inv_step vs vs'))
= elim_pure (in_state_prop p vs);
let vs' = next_chan_val x vs in
H.write r vs';
intro_pure (in_state_prop (step p x) vs');
intro_pure (chan_inv_step_p vs vs');
return vs'
[@@__reduce__]
let send_pre_available (p:sprot) #q (c:chan_t q) (vs vr:chan_val) = send_recv_in_sync c.send p c vs vr
let gather_r (#p:sprot) (r:ref chan_val) (v:chan_val)
: SteelT unit
(pts_to r half v `star` in_state r p)
(fun _ -> pts_to r full_perm v `star` in_state_slprop p v)
= let v' = witness_exists () in
H.higher_ref_pts_to_injective_eq #_ #_ #_ #_ #v #_ r;
H.gather #_ #_ #half #half #v #v r;
rewrite_slprop (pts_to r (sum_perm half half) v) (pts_to r full_perm v) (fun _ -> ());
rewrite_slprop (in_state_slprop p v') (in_state_slprop p v) (fun _ -> ())
let send_available (#p:sprot) #q (cc:chan q) (x:msg_t p) (vs vr:chan_val) (_:unit)
: SteelT unit (send_pre_available p #q cc.chan_chan vs vr) (fun _ -> sender cc (step p x))
= Steel.Utils.extract_pure (vs == vr);
Steel.Utils.rewrite #_ #(send_recv_in_sync cc.chan_chan.send p cc.chan_chan vs) vr vs;
elim_pure (vs == vs);
gather_r cc.chan_chan.send vs;
let next_vs = update_channel cc.chan_chan x vs cc.chan_chan.send in
H.share cc.chan_chan.send;
intro_exists next_vs (fun (next_vs:chan_val) -> pts_to cc.chan_chan.send half next_vs `star` in_state_slprop (step p x) next_vs);
intro_chan_inv_stepT cc.chan_chan next_vs vs;
Steel.SpinLock.release cc.chan_lock
let extensible (#p:prot) (x:partial_trace_of p) = P.more x.to
let next_msg_t (#p:prot) (x:partial_trace_of p) = P.next_msg_t x.to
let next_trace #p (vr:chan_val) (vs:chan_val)
(tr:partial_trace_of p)
(s:squash (until tr == step vr.chan_prot vr.chan_msg))
(_:squash (chan_inv_step_p vr vs))
: (ts:partial_trace_of p { until ts == step vs.chan_prot vs.chan_msg })
= let msg : next_msg_t tr = vs.chan_msg in
assert (extensible tr);
extend_partial_trace tr msg
let next_trace_st #p (vr:chan_val) (vs:chan_val) (tr:partial_trace_of p)
: Steel (extension_of tr)
(chan_inv_step vr vs)
(fun _ -> emp)
(requires fun _ -> until tr == step vr.chan_prot vr.chan_msg)
(ensures fun _ ts _ -> until ts == step vs.chan_prot vs.chan_msg)
= elim_pure (chan_inv_step_p vr vs);
let ts : extension_of tr = next_trace vr vs tr () () in
return ts | {
"checked_file": "/",
"dependencies": [
"Steel.Utils.fst.checked",
"Steel.SpinLock.fsti.checked",
"Steel.MonotonicHigherReference.fsti.checked",
"Steel.Memory.fsti.checked",
"Steel.HigherReference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"Steel.Channel.Protocol.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Channel.Simplex.fst"
} | [
{
"abbrev": true,
"full_module": "Steel.HigherReference",
"short_module": "H"
},
{
"abbrev": true,
"full_module": "Steel.MonotonicHigherReference",
"short_module": "MRef"
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.HigherReference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.SpinLock",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Channel.Protocol",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Channel.Protocol",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Channel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Channel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
r: Steel.Channel.Simplex.trace_ref p ->
vr: Steel.Channel.Simplex.chan_val ->
vs: Steel.Channel.Simplex.chan_val
-> Steel.Effect.Steel Prims.unit | Steel.Effect.Steel | [] | [] | [
"Steel.Channel.Simplex.prot",
"Steel.Channel.Simplex.trace_ref",
"Steel.Channel.Simplex.chan_val",
"Steel.Effect.Atomic.intro_exists",
"Steel.Channel.Protocol.partial_trace_of",
"FStar.Ghost.hide",
"FStar.Set.set",
"Steel.Memory.iname",
"FStar.Set.empty",
"Steel.Effect.Common.star",
"Steel.MonotonicHigherReference.pts_to",
"Steel.Channel.Protocol.extended_to",
"Steel.FractionalPermission.full_perm",
"Steel.Effect.Common.pure",
"Prims.eq2",
"Steel.Channel.Protocol.protocol",
"Prims.unit",
"Steel.Channel.Protocol.until",
"Steel.Channel.Simplex.step",
"Steel.Channel.Simplex.__proj__Mkchan_val__item__chan_prot",
"Steel.Channel.Simplex.__proj__Mkchan_val__item__chan_msg",
"Steel.Effect.Common.vprop",
"Steel.Effect.Atomic.intro_pure",
"Steel.MonotonicHigherReference.write",
"Steel.Channel.Protocol.extension_of",
"Steel.Channel.Simplex.next_trace_st",
"Steel.Effect.Atomic.elim_pure",
"Steel.MonotonicHigherReference.read_refine",
"Steel.Channel.Simplex.chan_inv_step_p",
"Steel.Channel.Simplex.trace_until",
"Steel.Effect.Common.rmem",
"Prims.l_True"
] | [] | false | true | false | false | false | let update_trace #p (r: trace_ref p) (vr: chan_val) (vs: chan_val)
: Steel unit
(trace_until r vr)
(fun _ -> trace_until r vs)
(requires fun _ -> chan_inv_step_p vr vs)
(ensures fun _ _ _ -> True) =
| intro_pure (chan_inv_step_p vr vs);
let tr = MRef.read_refine r in
elim_pure (until tr == step vr.chan_prot vr.chan_msg);
let ts:extension_of tr = next_trace_st vr vs tr in
MRef.write r ts;
intro_pure (until ts == step vs.chan_prot vs.chan_msg);
intro_exists ts
(fun (ts: partial_trace_of p) ->
(MRef.pts_to r full_perm ts) `star` (pure (until ts == step vs.chan_prot vs.chan_msg))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_qcode_Fast_add | val va_qcode_Fast_add (va_mods: va_mods_t) (dst_b inA_b inB_b: buffer64)
: (va_quickCode unit (va_code_Fast_add ())) | val va_qcode_Fast_add (va_mods: va_mods_t) (dst_b inA_b inB_b: buffer64)
: (va_quickCode unit (va_code_Fast_add ())) | let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(()))))))))))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 30,
"end_line": 1038,
"start_col": 0,
"start_line": 968
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ())))))))))))))))))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
va_mods: Vale.X64.QuickCode.va_mods_t ->
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
inB_b: Vale.X64.Memory.buffer64
-> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastUtil.va_code_Fast_add ()) | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.QuickCode.va_mods_t",
"Vale.X64.Memory.buffer64",
"Vale.X64.QuickCodes.qblock",
"Prims.unit",
"Prims.Cons",
"Vale.X64.Decls.va_code",
"Vale.X64.InsBasic.va_code_Xor64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.Machine_s.rRax",
"Vale.X64.InsMem.va_code_Load64_buffer",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRcx",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.InsMem.va_code_Mem64_lemma",
"Vale.X64.InsBasic.va_code_Add64Wrap",
"Vale.X64.Decls.va_opr_code_Mem64",
"Vale.X64.Decls.va_op_reg64_reg64",
"Vale.X64.Machine_s.rRsi",
"Vale.X64.InsMem.va_code_Store64_buffer",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rR10",
"Vale.X64.InsBasic.va_code_Adcx64Wrap",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rRbx",
"Prims.Nil",
"Vale.X64.Machine_s.precode",
"Vale.X64.Decls.ins",
"Vale.X64.Decls.ocmp",
"Vale.X64.Decls.va_state",
"Vale.X64.QuickCodes.va_qPURE",
"Prims.pure_post",
"Prims.l_and",
"Prims.l_True",
"Prims.l_Forall",
"Prims.l_imp",
"Vale.Def.Words_s.nat32",
"Prims.eq2",
"Vale.Def.Types_s.ixor",
"Prims.int",
"Vale.Def.Words_s.nat64",
"Vale.X64.QuickCodes.va_range1",
"Vale.Arch.Types.xor_lemmas",
"Vale.X64.QuickCodes.va_QSeq",
"Vale.X64.InsBasic.va_quick_Xor64",
"Vale.X64.InsMem.va_quick_Load64_buffer",
"Vale.X64.InsMem.va_quick_Mem64_lemma",
"Vale.X64.InsBasic.va_quick_Add64Wrap",
"Vale.X64.InsMem.va_quick_Store64_buffer",
"Vale.X64.InsBasic.va_quick_Adcx64Wrap",
"Vale.X64.QuickCodes.va_QEmpty",
"Prims.nat",
"Vale.Curve25519.Fast_defs.pow2_four",
"Vale.X64.Decls.buffer64_read",
"Vale.X64.Decls.va_get_mem_heaplet",
"Vale.X64.State.vale_state",
"Vale.X64.QuickCodes.quickCodes",
"Vale.X64.QuickCode.va_quickCode",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_add"
] | [] | false | false | false | false | false | let va_qcode_Fast_add (va_mods: va_mods_t) (dst_b inA_b inB_b: buffer64)
: (va_quickCode unit (va_code_Fast_add ())) =
| (qblock va_mods
(fun (va_s: va_state) ->
let va_old_s:va_state = va_s in
let a0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in
let a1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s)
in
let a2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s)
in
let a3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s)
in
let b0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s)
in
let b1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in
let b2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s)
in
let b3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s)
in
let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
let b:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_: unit) -> Vale.Arch.Types.xor_lemmas ())
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx)
0
Secret
inB_b
0)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi)
0
inA_b
0
Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi)
0
Secret))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9)
0
Secret
dst_b
0)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx)
8
Secret
inB_b
1)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi)
8
inA_b
1
Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi)
8
Secret))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10)
8
Secret
dst_b
1)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx)
16
Secret
inB_b
2)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi)
16
inA_b
2
Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64
rR11)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi)
16
Secret))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11)
16
Secret
dst_b
2)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_dst_opr64_reg64 rRbx
)
(va_op_reg_opr64_reg64 rRcx
)
24
Secret
inB_b
3)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRsi
)
24
inA_b
3
Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64
rRbx)
(va_opr_code_Mem64
(va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64
rRsi)
24
Secret))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer
(va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64
rRdi)
(va_op_reg_opr64_reg64
rRbx)
24
Secret
dst_b
3)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap
(va_op_dst_opr64_reg64
rRax)
(va_op_opr64_reg64
rR8))
(va_QEmpty (()
))))))))))
))))))))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_quick_Cswap_single | val va_quick_Cswap_single (offset: nat) (p0_b p1_b: buffer64)
: (va_quickCode unit (va_code_Cswap_single offset)) | val va_quick_Cswap_single (offset: nat) (p0_b p1_b: buffer64)
: (va_quickCode unit (va_code_Cswap_single offset)) | let va_quick_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) : (va_quickCode unit
(va_code_Cswap_single offset)) =
(va_QProc (va_code_Cswap_single offset) ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_mem]) (va_wp_Cswap_single offset p0_b p1_b)
(va_wpProof_Cswap_single offset p0_b p1_b)) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 47,
"end_line": 1708,
"start_col": 0,
"start_line": 1704
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub dst_b inA_b inB_b) (va_wpProof_Fast_sub dst_b inA_b inB_b))
#pop-options
//--
//-- Cswap_single
val va_code_Cswap_single : offset:nat -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap_single offset =
(va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 +
offset `op_Multiply` 8) Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_CNil ())))))))))
val va_codegen_success_Cswap_single : offset:nat -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap_single offset =
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_ttrue ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap_single (va_mods:va_mods_t) (offset:nat) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap_single offset)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 839 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 840 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 841 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 842 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 843 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 844 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi)
(va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 845 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdx)
(va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QEmpty
(()))))))))))
val va_lemma_Cswap_single : va_b0:va_code -> va_s0:va_state -> offset:nat -> p0_b:buffer64 ->
p1_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cswap_single offset) va_s0 /\ va_get_ok va_s0 /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p1_val else old_p0_val) /\ p1_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p0_val else old_p1_val))) /\ va_state_eq va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))
[@"opaque_to_smt"]
let va_lemma_Cswap_single va_b0 va_s0 offset p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap_single va_mods offset p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap_single offset) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 792 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 821 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 822 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdx va_sM) p1_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 824 column 57 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 832 column 59 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read p0_b i
(va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet 0
va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 834 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_val = Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 835 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_val = Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 836 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ ->
old_p0_val)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 837 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ ->
old_p1_val)))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
(0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall
(va_x_mem:vale_heap) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_heap0:vale_heap) .
let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9
va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_mem va_x_mem va_s0)))) in va_get_ok va_sM /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == va_if
(Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ -> old_p0_val) /\ p1_val
== va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ -> old_p1_val)))
==> va_k va_sM (())))
val va_wpProof_Cswap_single : offset:nat -> p0_b:buffer64 -> p1_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cswap_single offset p0_b p1_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cswap_single offset)
([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Cswap_single offset p0_b p1_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cswap_single (va_code_Cswap_single offset) va_s0 offset p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))));
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | offset: Prims.nat -> p0_b: Vale.X64.Memory.buffer64 -> p1_b: Vale.X64.Memory.buffer64
-> Vale.X64.QuickCode.va_quickCode Prims.unit
(Vale.Curve25519.X64.FastUtil.va_code_Cswap_single offset) | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"Vale.X64.Memory.buffer64",
"Vale.X64.QuickCode.va_QProc",
"Prims.unit",
"Vale.Curve25519.X64.FastUtil.va_code_Cswap_single",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_mem_heaplet",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"Vale.Curve25519.X64.FastUtil.va_wp_Cswap_single",
"Vale.Curve25519.X64.FastUtil.va_wpProof_Cswap_single",
"Vale.X64.QuickCode.va_quickCode"
] | [] | false | false | false | false | false | let va_quick_Cswap_single (offset: nat) (p0_b p1_b: buffer64)
: (va_quickCode unit (va_code_Cswap_single offset)) =
| (va_QProc (va_code_Cswap_single offset)
([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_mem])
(va_wp_Cswap_single offset p0_b p1_b)
(va_wpProof_Cswap_single offset p0_b p1_b)) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_quick_Fast_sub | val va_quick_Fast_sub (dst_b inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fast_sub ())) | val va_quick_Fast_sub (dst_b inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fast_sub ())) | let va_quick_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub dst_b inA_b inB_b) (va_wpProof_Fast_sub dst_b inA_b inB_b)) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 79,
"end_line": 1515,
"start_col": 0,
"start_line": 1511
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
inB_b: Vale.X64.Memory.buffer64
-> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastUtil.va_code_Fast_sub ()) | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Memory.buffer64",
"Vale.X64.QuickCode.va_QProc",
"Prims.unit",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_sub",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_Mod_mem_heaplet",
"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.rR8",
"Vale.X64.Machine_s.rRax",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"Vale.Curve25519.X64.FastUtil.va_wp_Fast_sub",
"Vale.Curve25519.X64.FastUtil.va_wpProof_Fast_sub",
"Vale.X64.QuickCode.va_quickCode"
] | [] | false | false | false | false | false | let va_quick_Fast_sub (dst_b inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fast_sub ())) =
| (va_QProc (va_code_Fast_sub ())
([
va_Mod_flags;
va_Mod_mem_heaplet 0;
va_Mod_reg64 rR11;
va_Mod_reg64 rR10;
va_Mod_reg64 rR9;
va_Mod_reg64 rR8;
va_Mod_reg64 rRax;
va_Mod_mem
])
(va_wp_Fast_sub dst_b inA_b inB_b)
(va_wpProof_Fast_sub dst_b inA_b inB_b)) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_lemma_Fast_sub1 | val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0))))))))))) | val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0))))))))))) | let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 16,
"end_line": 842,
"start_col": 0,
"start_line": 805
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0))))))))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 1200,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | Prims.Ghost | [] | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Memory.buffer64",
"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_mem_heaplet",
"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.rR8",
"Vale.X64.Machine_s.rRax",
"Vale.X64.QuickCode.va_Mod_ok",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.list",
"Vale.X64.QuickCode.__proj__QProc__item__mods",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_sub1",
"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.int",
"Prims.op_Subtraction",
"Vale.X64.Decls.va_mul_nat",
"Vale.X64.Decls.va_get_reg64",
"Vale.Curve25519.Fast_defs.pow2_256",
"Vale.X64.Machine_s.rRcx",
"Prims.l_or",
"Vale.X64.Decls.validSrcAddrs64",
"Vale.X64.Decls.va_get_mem_heaplet",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Decls.va_get_mem_layout",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.Decls.modifies_buffer",
"Prims.nat",
"Vale.Curve25519.Fast_defs.pow2_four",
"Vale.Def.Words_s.nat64",
"Vale.X64.Decls.buffer64_read",
"Vale.X64.QuickCode.quickCode",
"Vale.Curve25519.X64.FastUtil.va_qcode_Fast_sub1"
] | [] | false | false | false | false | false | let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
| let va_mods:va_mods_t =
[
va_Mod_flags;
va_Mod_mem_heaplet 0;
va_Mod_reg64 rR11;
va_Mod_reg64 rR10;
va_Mod_reg64 rR9;
va_Mod_reg64 rR8;
va_Mod_reg64 rRax;
va_Mod_ok;
va_Mod_mem
]
in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let va_sM, va_fM, va_g =
va_wp_sound_code_norm (va_code_Fast_sub1 ())
va_qc
va_s0
(fun va_s0 va_sM va_g ->
let () = va_g in
label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\
(let a0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in
let a1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in
let a2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0)
in
let a3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in
let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)
in
label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 ==
a - va_get_reg64 rRcx va_s0) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM)
dst_b
4
(va_get_mem_layout va_sM)
Secret) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0)
(va_get_mem_heaplet 0 va_sM)))))))))
in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([
va_Mod_flags;
va_Mod_mem_heaplet 0;
va_Mod_reg64 rR11;
va_Mod_reg64 rR10;
va_Mod_reg64 rR9;
va_Mod_reg64 rR8;
va_Mod_reg64 rRax;
va_Mod_ok;
va_Mod_mem
])
va_sM
va_s0;
(va_sM, va_fM) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_wpProof_Fast_sub | val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) | val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) | let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 22,
"end_line": 1508,
"start_col": 0,
"start_line": 1499
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
inB_b: Vale.X64.Memory.buffer64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | Prims.Ghost | [] | [] | [
"Vale.X64.Memory.buffer64",
"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_mem_heaplet",
"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.rR8",
"Vale.X64.Machine_s.rRax",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_mem_heaplet",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_mem",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.Curve25519.X64.FastUtil.va_lemma_Fast_sub",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_sub"
] | [] | false | false | false | false | false | let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
| let va_sM, va_f0 = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM
(va_update_mem_heaplet 0
va_sM
(va_update_reg64 rR11
va_sM
(va_update_reg64 rR10
va_sM
(va_update_reg64 rR9
va_sM
(va_update_reg64 rR8
va_sM
(va_update_reg64 rRax
va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([
va_Mod_flags;
va_Mod_mem_heaplet 0;
va_Mod_reg64 rR11;
va_Mod_reg64 rR10;
va_Mod_reg64 rR9;
va_Mod_reg64 rR8;
va_Mod_reg64 rRax;
va_Mod_mem
])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_wpProof_Cswap_single | val va_wpProof_Cswap_single : offset:nat -> p0_b:buffer64 -> p1_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cswap_single offset p0_b p1_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cswap_single offset)
([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g)))) | val va_wpProof_Cswap_single : offset:nat -> p0_b:buffer64 -> p1_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cswap_single offset p0_b p1_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cswap_single offset)
([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g)))) | let va_wpProof_Cswap_single offset p0_b p1_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cswap_single (va_code_Cswap_single offset) va_s0 offset p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))));
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 22,
"end_line": 1701,
"start_col": 0,
"start_line": 1692
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub dst_b inA_b inB_b) (va_wpProof_Fast_sub dst_b inA_b inB_b))
#pop-options
//--
//-- Cswap_single
val va_code_Cswap_single : offset:nat -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap_single offset =
(va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 +
offset `op_Multiply` 8) Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_CNil ())))))))))
val va_codegen_success_Cswap_single : offset:nat -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap_single offset =
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_ttrue ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap_single (va_mods:va_mods_t) (offset:nat) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap_single offset)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 839 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 840 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 841 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 842 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 843 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 844 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi)
(va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 845 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdx)
(va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QEmpty
(()))))))))))
val va_lemma_Cswap_single : va_b0:va_code -> va_s0:va_state -> offset:nat -> p0_b:buffer64 ->
p1_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cswap_single offset) va_s0 /\ va_get_ok va_s0 /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p1_val else old_p0_val) /\ p1_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p0_val else old_p1_val))) /\ va_state_eq va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))
[@"opaque_to_smt"]
let va_lemma_Cswap_single va_b0 va_s0 offset p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap_single va_mods offset p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap_single offset) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 792 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 821 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 822 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdx va_sM) p1_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 824 column 57 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 832 column 59 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read p0_b i
(va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet 0
va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 834 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_val = Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 835 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_val = Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 836 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ ->
old_p0_val)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 837 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ ->
old_p1_val)))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
(0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall
(va_x_mem:vale_heap) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_heap0:vale_heap) .
let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9
va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_mem va_x_mem va_s0)))) in va_get_ok va_sM /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == va_if
(Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ -> old_p0_val) /\ p1_val
== va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ -> old_p1_val)))
==> va_k va_sM (())))
val va_wpProof_Cswap_single : offset:nat -> p0_b:buffer64 -> p1_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cswap_single offset p0_b p1_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cswap_single offset)
([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g)))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
offset: Prims.nat ->
p0_b: Vale.X64.Memory.buffer64 ->
p1_b: Vale.X64.Memory.buffer64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | Prims.Ghost | [] | [] | [
"Prims.nat",
"Vale.X64.Memory.buffer64",
"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_mem_heaplet",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_mem_heaplet",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_mem",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.Curve25519.X64.FastUtil.va_lemma_Cswap_single",
"Vale.Curve25519.X64.FastUtil.va_code_Cswap_single"
] | [] | false | false | false | false | false | let va_wpProof_Cswap_single offset p0_b p1_b va_s0 va_k =
| let va_sM, va_f0 = va_lemma_Cswap_single (va_code_Cswap_single offset) va_s0 offset p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_mem_heaplet 0
va_sM
(va_update_reg64 rR10
va_sM
(va_update_reg64 rR9
va_sM
(va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))));
va_lemma_norm_mods ([
va_Mod_mem_heaplet 0;
va_Mod_reg64 rR10;
va_Mod_reg64 rR9;
va_Mod_reg64 rR8;
va_Mod_mem
])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_qcode_Fast_sub | val va_qcode_Fast_sub (va_mods: va_mods_t) (dst_b inA_b inB_b: buffer64)
: (va_quickCode unit (va_code_Fast_sub ())) | val va_qcode_Fast_sub (va_mods: va_mods_t) (dst_b inA_b inB_b: buffer64)
: (va_quickCode unit (va_code_Fast_sub ())) | let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (())))))))))))))))))))))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 88,
"end_line": 1349,
"start_col": 0,
"start_line": 1270
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ()))))))))))))))))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
va_mods: Vale.X64.QuickCode.va_mods_t ->
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
inB_b: Vale.X64.Memory.buffer64
-> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastUtil.va_code_Fast_sub ()) | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.QuickCode.va_mods_t",
"Vale.X64.Memory.buffer64",
"Vale.X64.QuickCodes.qblock",
"Prims.unit",
"Prims.Cons",
"Vale.X64.Decls.va_code",
"Vale.X64.InsBasic.va_code_Xor64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.InsMem.va_code_Load64_buffer",
"Vale.X64.Decls.va_op_heaplet_mem_heaplet",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRsi",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.InsMem.va_code_Mem64_lemma",
"Vale.X64.InsBasic.va_code_Sub64Wrap",
"Vale.X64.Decls.va_opr_code_Mem64",
"Vale.X64.Decls.va_op_reg64_reg64",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.InsMem.va_code_Store64_buffer",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rR9",
"Vale.X64.InsBasic.va_code_Sbb64",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR11",
"Vale.X64.InsBasic.va_code_Adc64Wrap",
"Prims.Nil",
"Vale.X64.Machine_s.precode",
"Vale.X64.Decls.ins",
"Vale.X64.Decls.ocmp",
"Vale.X64.Decls.va_state",
"Vale.X64.QuickCodes.va_qPURE",
"Prims.pure_post",
"Prims.l_and",
"Prims.l_True",
"Prims.l_Forall",
"Prims.l_imp",
"Vale.Def.Words_s.nat32",
"Prims.eq2",
"Vale.Def.Types_s.ixor",
"Prims.int",
"Vale.Def.Words_s.nat64",
"Vale.X64.QuickCodes.va_range1",
"Vale.Arch.Types.xor_lemmas",
"Vale.X64.QuickCodes.va_QSeq",
"Vale.X64.InsBasic.va_quick_Xor64",
"Vale.X64.InsMem.va_quick_Load64_buffer",
"Vale.X64.InsMem.va_quick_Mem64_lemma",
"Vale.X64.InsBasic.va_quick_Sub64Wrap",
"Vale.X64.InsMem.va_quick_Store64_buffer",
"Vale.X64.InsBasic.va_quick_Sbb64",
"Vale.X64.QuickCodes.va_QBind",
"Vale.X64.InsBasic.va_quick_Adc64Wrap",
"Vale.X64.QuickCodes.va_qAssert",
"Prims.nat",
"Prims.l_or",
"Prims.b2t",
"Prims.op_LessThan",
"Vale.Def.Words_s.pow2_64",
"Prims.op_LessThanOrEqual",
"Vale.X64.Decls.va_get_reg64",
"Vale.Curve25519.Fast_defs.bool_bit",
"Prims.op_Equality",
"Vale.Curve25519.Fast_defs.pow2_four",
"Vale.Curve25519.FastUtil_helpers.sub_carry",
"Vale.Curve25519.Fast_defs.bit",
"Prims.logical",
"Prims.op_Subtraction",
"Prims.op_Multiply",
"Vale.Curve25519.FastUtil_helpers.lemma_sub",
"Vale.X64.QuickCodes.va_QEmpty",
"Vale.X64.QuickCodes.quickCodes",
"Prims.bool",
"Vale.X64.Decls.cf",
"Vale.X64.Decls.va_get_flags",
"Vale.X64.Decls.buffer64_read",
"Vale.X64.Decls.va_get_mem_heaplet",
"Vale.X64.State.vale_state",
"Vale.X64.QuickCode.va_quickCode",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_sub"
] | [] | false | false | false | false | false | let va_qcode_Fast_sub (va_mods: va_mods_t) (dst_b inA_b inB_b: buffer64)
: (va_quickCode unit (va_code_Fast_sub ())) =
| (qblock va_mods
(fun (va_s: va_state) ->
let va_old_s:va_state = va_s in
let a0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in
let a1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s)
in
let a2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s)
in
let a3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s)
in
let b0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s)
in
let b1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in
let b2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s)
in
let b3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s)
in
let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
let b:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_: unit) -> Vale.Arch.Types.xor_lemmas ())
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi)
0
Secret
inA_b
0)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx)
0
inB_b
0
Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx)
0
Secret))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8)
0
Secret
dst_b
0)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi)
8
Secret
inA_b
1)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx)
8
inB_b
1
Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx)
8
Secret))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9)
8
Secret
dst_b
1)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi)
16
Secret
inA_b
2)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRcx)
16
inB_b
2
Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10
)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRcx)
16
Secret))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10)
16
Secret
dst_b
2)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet
0)
(va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi)
24
Secret
inA_b
3)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64 rRcx)
24
inB_b
3
Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64
rR11)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0)
(va_op_reg64_reg64
rRcx)
24
Secret))
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer
(va_op_heaplet_mem_heaplet
0)
(va_op_reg_opr64_reg64
rRdi)
(va_op_reg_opr64_reg64
rR11)
24
Secret
dst_b
3)
(fun
(va_s: va_state)
_
->
let c:bool =
Vale.X64.Decls.cf
(va_get_flags va_s
)
in
va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap
(va_op_dst_opr64_reg64
rRax)
(va_op_opr64_reg64
rRax))
(fun
(va_s:
va_state)
_
->
va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64
rRax
va_s ==
Vale.Curve25519.Fast_defs.bool_bit
c)
(let
va_arg41:Vale.Curve25519.Fast_defs.bit
=
Vale.Curve25519.Fast_defs.bool_bit
c
in
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
rR10
va_s
in
let
va_arg38:Vale.Def.Types_s.nat64
=
va_get_reg64
rR9
va_s
in
let
va_arg37:Vale.Def.Types_s.nat64
=
va_get_reg64
rR8
va_s
in
va_qPURE
va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun
(_:
unit
)
->
Vale.Curve25519.FastUtil_helpers.lemma_sub
a
a0
a1
a2
a3
b
b0
b1
b2
b3
va_arg37
va_arg38
va_arg39
va_arg40
va_arg41
)
(va_QEmpty
(()
))
))))))))))
)))))))))))) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_lemma_Fast_add1 | val va_lemma_Fast_add1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB:nat64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled
/\ Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ inB == va_get_reg64 rRdx
va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in
let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in
let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in
let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in
let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a +
va_get_reg64 rRdx va_s0 /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) | val va_lemma_Fast_add1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB:nat64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled
/\ Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ inB == va_get_reg64 rRdx
va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in
let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in
let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in
let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in
let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a +
va_get_reg64 rRdx va_s0 /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) | let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 16,
"end_line": 493,
"start_col": 0,
"start_line": 460
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (()))))))))))))))))))))))))))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
inB: Vale.X64.Memory.nat64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | Prims.Ghost | [] | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Memory.buffer64",
"Vale.X64.Memory.nat64",
"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_mem_layout",
"Vale.X64.QuickCode.va_Mod_mem_heaplet",
"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.rR8",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rRax",
"Vale.X64.QuickCode.va_Mod_ok",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.list",
"Vale.X64.QuickCode.__proj__QProc__item__mods",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_add1",
"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.int",
"Prims.op_Addition",
"Vale.X64.Decls.va_get_reg64",
"Vale.X64.Decls.modifies_buffer",
"Vale.X64.Decls.va_get_mem",
"Prims.nat",
"Vale.Curve25519.Fast_defs.pow2_five",
"Vale.Def.Words_s.nat64",
"Vale.X64.Decls.buffer64_read",
"Vale.Curve25519.Fast_defs.pow2_four",
"Vale.X64.QuickCode.quickCode",
"Vale.Curve25519.X64.FastUtil.va_qcode_Fast_add1"
] | [] | false | false | false | false | false | let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
| let va_mods:va_mods_t =
[
va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem
]
in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let va_sM, va_fM, va_g =
va_wp_sound_code_norm (va_code_Fast_add1 ())
va_qc
va_s0
(fun va_s0 va_sM va_g ->
let () = va_g in
label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\
(let a0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in
let a1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in
let a2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in
let a3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in
let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d =
Vale.Curve25519.Fast_defs.pow2_five d0
d1
d2
d3
(va_get_reg64 rRax va_sM)
in
label va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem va_s0)
(va_get_mem va_sM)))))))))
in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([
va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem
])
va_sM
va_s0;
(va_sM, va_fM) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_lemma_Cswap_single | val va_lemma_Cswap_single : va_b0:va_code -> va_s0:va_state -> offset:nat -> p0_b:buffer64 ->
p1_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cswap_single offset) va_s0 /\ va_get_ok va_s0 /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p1_val else old_p0_val) /\ p1_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p0_val else old_p1_val))) /\ va_state_eq va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))) | val va_lemma_Cswap_single : va_b0:va_code -> va_s0:va_state -> offset:nat -> p0_b:buffer64 ->
p1_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cswap_single offset) va_s0 /\ va_get_ok va_s0 /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p1_val else old_p0_val) /\ p1_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p0_val else old_p1_val))) /\ va_state_eq va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))) | let va_lemma_Cswap_single va_b0 va_s0 offset p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap_single va_mods offset p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap_single offset) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 792 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 821 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 822 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdx va_sM) p1_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 824 column 57 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 832 column 59 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read p0_b i
(va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet 0
va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 834 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_val = Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 835 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_val = Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 836 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ ->
old_p0_val)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 837 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ ->
old_p1_val)))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 16,
"end_line": 1651,
"start_col": 0,
"start_line": 1612
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub dst_b inA_b inB_b) (va_wpProof_Fast_sub dst_b inA_b inB_b))
#pop-options
//--
//-- Cswap_single
val va_code_Cswap_single : offset:nat -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap_single offset =
(va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 +
offset `op_Multiply` 8) Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_CNil ())))))))))
val va_codegen_success_Cswap_single : offset:nat -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap_single offset =
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_ttrue ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap_single (va_mods:va_mods_t) (offset:nat) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap_single offset)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 839 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 840 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 841 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 842 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 843 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 844 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi)
(va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 845 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdx)
(va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QEmpty
(()))))))))))
val va_lemma_Cswap_single : va_b0:va_code -> va_s0:va_state -> offset:nat -> p0_b:buffer64 ->
p1_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cswap_single offset) va_s0 /\ va_get_ok va_s0 /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p1_val else old_p0_val) /\ p1_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p0_val else old_p1_val))) /\ va_state_eq va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
offset: Prims.nat ->
p0_b: Vale.X64.Memory.buffer64 ->
p1_b: Vale.X64.Memory.buffer64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | Prims.Ghost | [] | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Prims.nat",
"Vale.X64.Memory.buffer64",
"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_mem_heaplet",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.QuickCode.va_Mod_ok",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.list",
"Vale.X64.QuickCode.__proj__QProc__item__mods",
"Vale.Curve25519.X64.FastUtil.va_code_Cswap_single",
"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",
"Vale.X64.Decls.validSrcAddrs64",
"Vale.X64.Decls.va_get_mem_heaplet",
"Vale.X64.Decls.va_get_reg64",
"Vale.X64.Machine_s.rRsi",
"Vale.X64.Decls.va_get_mem_layout",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Decls.modifies_buffer_2",
"Prims.l_Forall",
"Prims.l_imp",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"Prims.l_not",
"Vale.Def.Types_s.nat64",
"Vale.X64.Decls.buffer64_read",
"Vale.Def.Words_s.nat64",
"Vale.X64.Decls.va_if",
"Vale.X64.Decls.cf",
"Vale.X64.Decls.va_get_flags",
"Prims.op_Addition",
"Vale.X64.QuickCode.quickCode",
"Vale.Curve25519.X64.FastUtil.va_qcode_Cswap_single"
] | [] | false | false | false | false | false | let va_lemma_Cswap_single va_b0 va_s0 offset p0_b p1_b =
| let va_mods:va_mods_t =
[
va_Mod_mem_heaplet 0;
va_Mod_reg64 rR10;
va_Mod_reg64 rR9;
va_Mod_reg64 rR8;
va_Mod_ok;
va_Mod_mem
]
in
let va_qc = va_qcode_Cswap_single va_mods offset p0_b p1_b in
let va_sM, va_fM, va_g =
va_wp_sound_code_norm (va_code_Cswap_single offset)
va_qc
va_s0
(fun va_s0 va_sM va_g ->
let () = va_g in
label va_range1
"***** POSTCONDITION NOT MET AT line 792 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\
(let old_p0_val:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_s0)
in
let old_p1_val:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0)
in
label va_range1
"***** POSTCONDITION NOT MET AT line 821 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRsi va_sM)
p0_b
8
(va_get_mem_layout va_sM)
Secret) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 822 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM)
p1_b
8
(va_get_mem_layout va_sM)
Secret) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 824 column 57 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b
p1_b
(va_get_mem_heaplet 0 va_s0)
(va_get_mem_heaplet 0 va_sM)) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 832 column 59 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(forall (i: nat).
0 <= i /\ i < 8 /\ i =!= offset ==>
Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet 0 va_s0) /\
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 834 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM)
in
label va_range1
"***** POSTCONDITION NOT MET AT line 835 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM)
in
label va_range1
"***** POSTCONDITION NOT MET AT line 836 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_val ==
va_if (Vale.X64.Decls.cf (va_get_flags va_sM))
(fun _ -> old_p1_val)
(fun _ -> old_p0_val)) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 837 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_val ==
va_if (Vale.X64.Decls.cf (va_get_flags va_sM))
(fun _ -> old_p0_val)
(fun _ -> old_p1_val))))))
in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([
va_Mod_mem_heaplet 0;
va_Mod_reg64 rR10;
va_Mod_reg64 rR9;
va_Mod_reg64 rR8;
va_Mod_ok;
va_Mod_mem
])
va_sM
va_s0;
(va_sM, va_fM) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_lemma_Fast_add1_stdcall | val va_lemma_Fast_add1_stdcall : va_b0:va_code -> va_s0:va_state -> win:bool -> dst_b:buffer64 ->
inA_b:buffer64 -> inB_in:nat64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add1_stdcall win) va_s0 /\ va_get_ok va_s0 /\
(let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else
va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then
va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in va_get_reg64 rRsp va_s0 ==
Vale.X64.Stack_i.init_rsp (va_get_stack va_s0) /\ Vale.X64.Memory.is_initial_heap
(va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (adx_enabled /\ bmi2_enabled) /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\ inB_in = (if win then
va_get_reg64 rR8 va_s0 else va_get_reg64 rRdx va_s0) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem va_s0) dst_in dst_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) inA_in inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else
va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then
va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let a0 = Vale.X64.Decls.buffer64_read
inA_b 0 (va_get_mem va_s0) in let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0)
in let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let a3 =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let a =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five
d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + inB_in /\ Vale.X64.Decls.modifies_buffer
dst_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (win ==> va_get_reg64 rRbx va_sM == va_get_reg64
rRbx va_s0) /\ (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (win ==>
va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ (win ==> va_get_reg64 rRsi va_sM ==
va_get_reg64 rRsi va_s0) /\ (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (win ==> va_get_reg64 rR14
va_sM == va_get_reg64 rR14 va_s0) /\ (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15
va_s0) /\ (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (~win ==>
va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (~win ==> va_get_reg64 rR13 va_sM ==
va_get_reg64 rR13 va_s0) /\ (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ va_get_reg64 rRsp va_sM ==
va_get_reg64 rRsp va_s0) /\ va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack
va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))))) | val va_lemma_Fast_add1_stdcall : va_b0:va_code -> va_s0:va_state -> win:bool -> dst_b:buffer64 ->
inA_b:buffer64 -> inB_in:nat64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add1_stdcall win) va_s0 /\ va_get_ok va_s0 /\
(let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else
va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then
va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in va_get_reg64 rRsp va_s0 ==
Vale.X64.Stack_i.init_rsp (va_get_stack va_s0) /\ Vale.X64.Memory.is_initial_heap
(va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (adx_enabled /\ bmi2_enabled) /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\ inB_in = (if win then
va_get_reg64 rR8 va_s0 else va_get_reg64 rRdx va_s0) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem va_s0) dst_in dst_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) inA_in inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else
va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then
va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let a0 = Vale.X64.Decls.buffer64_read
inA_b 0 (va_get_mem va_s0) in let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0)
in let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let a3 =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let a =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five
d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + inB_in /\ Vale.X64.Decls.modifies_buffer
dst_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (win ==> va_get_reg64 rRbx va_sM == va_get_reg64
rRbx va_s0) /\ (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (win ==>
va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ (win ==> va_get_reg64 rRsi va_sM ==
va_get_reg64 rRsi va_s0) /\ (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (win ==> va_get_reg64 rR14
va_sM == va_get_reg64 rR14 va_s0) /\ (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15
va_s0) /\ (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (~win ==>
va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (~win ==> va_get_reg64 rR13 va_sM ==
va_get_reg64 rR13 va_s0) /\ (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ va_get_reg64 rRsp va_sM ==
va_get_reg64 rRsp va_s0) /\ va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack
va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))))) | let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 16,
"end_line": 641,
"start_col": 0,
"start_line": 568
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
win: Prims.bool ->
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
inB_in: Vale.X64.Memory.nat64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | Prims.Ghost | [] | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Prims.bool",
"Vale.X64.Memory.buffer64",
"Vale.X64.Memory.nat64",
"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_stackTaint",
"Vale.X64.QuickCode.va_Mod_stack",
"Vale.X64.QuickCode.va_Mod_mem_layout",
"Vale.X64.QuickCode.va_Mod_mem_heaplet",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rR15",
"Vale.X64.Machine_s.rR14",
"Vale.X64.Machine_s.rR13",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Machine_s.rRsp",
"Vale.X64.Machine_s.rRbp",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rRsi",
"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",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.list",
"Vale.X64.QuickCode.__proj__QProc__item__mods",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_add1_stdcall",
"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.int",
"Prims.op_Addition",
"Vale.X64.Decls.modifies_buffer",
"Vale.X64.Decls.va_get_mem",
"Prims.l_imp",
"Vale.Def.Types_s.nat64",
"Vale.X64.Decls.va_get_reg64",
"Prims.l_not",
"Prims.nat",
"Vale.Curve25519.Fast_defs.pow2_five",
"Vale.Curve25519.Fast_defs.pow2_four",
"Vale.Def.Words_s.nat64",
"Vale.X64.Decls.buffer64_read",
"Vale.X64.Decls.va_int_range",
"Vale.X64.Decls.va_if",
"Vale.X64.QuickCode.quickCode",
"Vale.Curve25519.X64.FastUtil.va_qcode_Fast_add1_stdcall"
] | [] | false | false | false | false | false | let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
| let va_mods:va_mods_t =
[
va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags;
va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi;
va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem
]
in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let va_sM, va_fM, va_g =
va_wp_sound_code_norm (va_code_Fast_add1_stdcall win)
va_qc
va_s0
(fun va_s0 va_sM va_g ->
let () = va_g in
label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\
(let dst_in:(va_int_range 0 18446744073709551615) =
va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0)
in
let inA_in:(va_int_range 0 18446744073709551615) =
va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0)
in
label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in
label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in
label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in
label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in
label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM)
in
label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM)
in
label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3
in
label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d =
Vale.Curve25519.Fast_defs.pow2_five d0
d1
d2
d3
(va_get_reg64 rRax va_sM)
in
label va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem va_s0)
(va_get_mem va_sM)) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==>
va_get_reg64 rRbx va_sM ==
va_get_reg64 rRbx va_s0) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==>
va_get_reg64 rRbp va_sM ==
va_get_reg64 rRbp va_s0) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==>
va_get_reg64 rRdi va_sM ==
va_get_reg64 rRdi va_s0) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==>
va_get_reg64 rRsi va_sM ==
va_get_reg64 rRsi va_s0) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==>
va_get_reg64 rRsp va_sM ==
va_get_reg64 rRsp va_s0) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==>
va_get_reg64 rR13 va_sM ==
va_get_reg64 rR13 va_s0) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==>
va_get_reg64 rR14 va_sM ==
va_get_reg64 rR14 va_s0) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==>
va_get_reg64 rR15 va_sM ==
va_get_reg64 rR15 va_s0) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==>
va_get_reg64 rRbx va_sM ==
va_get_reg64 rRbx va_s0) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==>
va_get_reg64 rRbp va_sM ==
va_get_reg64 rRbp va_s0) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==>
va_get_reg64 rR13 va_sM ==
va_get_reg64 rR13 va_s0) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==>
va_get_reg64 rR14 va_sM ==
va_get_reg64 rR14 va_s0) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==>
va_get_reg64 rR15 va_sM ==
va_get_reg64 rR15 va_s0) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM ==
va_get_reg64 rRsp va_s0)))))))))))))
in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([
va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags;
va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi;
va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem
])
va_sM
va_s0;
(va_sM, va_fM) | false |
Steel.Channel.Simplex.fst | Steel.Channel.Simplex.extend_history | val extend_history (#q: _) (#tr: partial_trace_of q) (#v: chan_val) (c: chan q) (tok: history c tr)
: Steel (tr': extension_of tr & history c tr')
((pts_to c.chan_chan.recv half v) `star` (trace_until c.chan_chan.trace v))
(fun _ -> (pts_to c.chan_chan.recv half v) `star` (trace_until c.chan_chan.trace v))
(requires fun _ -> True)
(ensures fun _ tr' _ -> until (dfst tr') == step v.chan_prot v.chan_msg) | val extend_history (#q: _) (#tr: partial_trace_of q) (#v: chan_val) (c: chan q) (tok: history c tr)
: Steel (tr': extension_of tr & history c tr')
((pts_to c.chan_chan.recv half v) `star` (trace_until c.chan_chan.trace v))
(fun _ -> (pts_to c.chan_chan.recv half v) `star` (trace_until c.chan_chan.trace v))
(requires fun _ -> True)
(ensures fun _ tr' _ -> until (dfst tr') == step v.chan_prot v.chan_msg) | let extend_history #q (#tr:partial_trace_of q)
(#v:chan_val)
(c:chan q)
(tok:history c tr)
: Steel (tr':extension_of tr & history c tr')
(pts_to c.chan_chan.recv half v `star`
trace_until c.chan_chan.trace v)
(fun _ -> pts_to c.chan_chan.recv half v `star`
trace_until c.chan_chan.trace v)
(requires fun _ -> True)
(ensures fun _ tr' _ -> until (dfst tr') == step v.chan_prot v.chan_msg)
= let tr' = MRef.read_refine c.chan_chan.trace in
let _ = recall_trace_ref c.chan_chan.trace tr tr' tok in
let tok' = MRef.witness c.chan_chan.trace (history_p tr') tr' () in
elim_pure (until tr' == step v.chan_prot v.chan_msg);
intro_trace_until c.chan_chan.trace tr' v;
let tr'' : extension_of tr = tr' in
(| tr'', tok' |) | {
"file_name": "lib/steel/Steel.Channel.Simplex.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 20,
"end_line": 477,
"start_col": 0,
"start_line": 460
} | (*
Copyright 2020 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 Steel.Channel.Simplex
module P = Steel.Channel.Protocol
open Steel.SpinLock
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.HigherReference
open Steel.FractionalPermission
module MRef = Steel.MonotonicHigherReference
module H = Steel.HigherReference
let sprot = p:prot { more p }
noeq
type chan_val = {
chan_prot : sprot;
chan_msg : msg_t chan_prot;
chan_ctr : nat
}
let mref a p = MRef.ref a p
let trace_ref (p:prot) = mref (partial_trace_of p) extended_to
noeq
type chan_t (p:prot) = {
send: ref chan_val;
recv: ref chan_val;
trace: trace_ref p;
}
let half : perm = half_perm full_perm
let step (s:sprot) (x:msg_t s) = step s x
let chan_inv_step_p (vrecv vsend:chan_val) : prop =
(vsend.chan_prot == step vrecv.chan_prot vrecv.chan_msg /\
vsend.chan_ctr == vrecv.chan_ctr + 1)
let chan_inv_step (vrecv vsend:chan_val) : vprop =
pure (chan_inv_step_p vrecv vsend)
let chan_inv_cond (vsend:chan_val) (vrecv:chan_val) : vprop =
if vsend.chan_ctr = vrecv.chan_ctr
then pure (vsend == vrecv)
else chan_inv_step vrecv vsend
let trace_until_prop #p (r:trace_ref p) (vr:chan_val) (tr: partial_trace_of p) : vprop =
MRef.pts_to r full_perm tr `star`
pure (until tr == step vr.chan_prot vr.chan_msg)
let trace_until #p (r:trace_ref p) (vr:chan_val) =
h_exists (trace_until_prop r vr)
let chan_inv_recv #p (c:chan_t p) (vsend:chan_val) =
h_exists (fun (vrecv:chan_val) ->
pts_to c.recv half vrecv `star`
trace_until c.trace vrecv `star`
chan_inv_cond vsend vrecv)
let chan_inv #p (c:chan_t p) : vprop =
h_exists (fun (vsend:chan_val) ->
pts_to c.send half vsend `star` chan_inv_recv c vsend)
let intro_chan_inv_cond_eqT (vs vr:chan_val)
: Steel unit emp
(fun _ -> chan_inv_cond vs vr)
(requires fun _ -> vs == vr)
(ensures fun _ _ _ -> True)
= intro_pure (vs == vs);
rewrite_slprop (chan_inv_cond vs vs) (chan_inv_cond vs vr) (fun _ -> ())
let intro_chan_inv_cond_stepT (vs vr:chan_val)
: SteelT unit (chan_inv_step vr vs)
(fun _ -> chan_inv_cond vs vr)
= Steel.Utils.extract_pure (chan_inv_step_p vr vs);
rewrite_slprop (chan_inv_step vr vs) (chan_inv_cond vs vr) (fun _ -> ())
let intro_chan_inv_auxT #p (#vs : chan_val)
(#vr : chan_val)
(c:chan_t p)
: SteelT unit (pts_to c.send half vs `star`
pts_to c.recv half vr `star`
trace_until c.trace vr `star`
chan_inv_cond vs vr)
(fun _ -> chan_inv c)
= intro_exists _ (fun (vr:chan_val) -> pts_to c.recv half vr `star` trace_until c.trace vr `star` chan_inv_cond vs vr);
intro_exists _ (fun (vs:chan_val) -> pts_to c.send half vs `star` chan_inv_recv c vs)
let intro_chan_inv_stepT #p (c:chan_t p) (vs vr:chan_val)
: SteelT unit (pts_to c.send half vs `star`
pts_to c.recv half vr `star`
trace_until c.trace vr `star`
chan_inv_step vr vs)
(fun _ -> chan_inv c)
= intro_chan_inv_cond_stepT vs vr;
intro_chan_inv_auxT c
let intro_chan_inv_eqT #p (c:chan_t p) (vs vr:chan_val)
: Steel unit (pts_to c.send half vs `star`
pts_to c.recv half vr `star`
trace_until c.trace vr)
(fun _ -> chan_inv c)
(requires fun _ -> vs == vr)
(ensures fun _ _ _ -> True)
= intro_chan_inv_cond_eqT vs vr;
intro_chan_inv_auxT c
noeq
type chan p = {
chan_chan : chan_t p;
chan_lock : lock (chan_inv chan_chan)
}
let in_state_prop (p:prot) (vsend:chan_val) : prop =
p == step vsend.chan_prot vsend.chan_msg
irreducible
let next_chan_val (#p:sprot) (x:msg_t p) (vs0:chan_val { in_state_prop p vs0 })
: Tot (vs:chan_val{in_state_prop (step p x) vs /\ chan_inv_step_p vs0 vs})
= {
chan_prot = (step vs0.chan_prot vs0.chan_msg);
chan_msg = x;
chan_ctr = vs0.chan_ctr + 1
}
[@@__reduce__]
let in_state_slprop (p:prot) (vsend:chan_val) : vprop = pure (in_state_prop p vsend)
let in_state (r:ref chan_val) (p:prot) =
h_exists (fun (vsend:chan_val) ->
pts_to r half vsend `star` in_state_slprop p vsend)
let sender #q (c:chan q) (p:prot) = in_state c.chan_chan.send p
let receiver #q (c:chan q) (p:prot) = in_state c.chan_chan.recv p
let intro_chan_inv #p (c:chan_t p) (v:chan_val)
: SteelT unit (pts_to c.send half v `star`
pts_to c.recv half v `star`
trace_until c.trace v)
(fun _ -> chan_inv c)
= intro_chan_inv_eqT c v v
let chan_val_p (p:prot) = (vs0:chan_val { in_state_prop p vs0 })
let intro_in_state (r:ref chan_val) (p:prot) (v:chan_val_p p)
: SteelT unit (pts_to r half v) (fun _ -> in_state r p)
= intro_pure (in_state_prop p v);
intro_exists v (fun (v:chan_val) -> pts_to r half v `star` in_state_slprop p v)
let msg t p = Msg Send unit (fun _ -> p)
let init_chan_val (p:prot) = v:chan_val {v.chan_prot == msg unit p}
let initial_trace (p:prot) : (q:partial_trace_of p {until q == p})
= { to = p; tr=Waiting p}
let intro_trace_until #q (r:trace_ref q) (tr:partial_trace_of q) (v:chan_val)
: Steel unit (MRef.pts_to r full_perm tr)
(fun _ -> trace_until r v)
(requires fun _ -> until tr == step v.chan_prot v.chan_msg)
(ensures fun _ _ _ -> True)
= intro_pure (until tr == step v.chan_prot v.chan_msg);
intro_exists tr
(fun (tr:partial_trace_of q) ->
MRef.pts_to r full_perm tr `star`
pure (until tr == (step v.chan_prot v.chan_msg)));
()
let chan_t_sr (p:prot) (send recv:ref chan_val) = (c:chan_t p{c.send == send /\ c.recv == recv})
let intro_trace_until_init #p (c:chan_t p) (v:init_chan_val p)
: SteelT unit (MRef.pts_to c.trace full_perm (initial_trace p))
(fun _ -> trace_until c.trace v)
= intro_pure (until (initial_trace p) == step v.chan_prot v.chan_msg);
//TODO: Not sure why I need this rewrite
rewrite_slprop (MRef.pts_to c.trace full_perm (initial_trace p) `star`
pure (until (initial_trace p) == step v.chan_prot v.chan_msg))
(MRef.pts_to c.trace full_perm (initial_trace p) `star`
pure (until (initial_trace p) == step v.chan_prot v.chan_msg))
(fun _ -> ());
intro_exists (initial_trace p) (trace_until_prop c.trace v)
let mk_chan (#p:prot) (send recv:ref chan_val) (v:init_chan_val p)
: SteelT (chan_t_sr p send recv)
(pts_to send half v `star` pts_to recv half v)
(fun c -> chan_inv c)
= let tr: trace_ref p = MRef.alloc (extended_to #p) (initial_trace p) in
let c = Mkchan_t send recv tr in
rewrite_slprop
(MRef.pts_to tr full_perm (initial_trace p))
(MRef.pts_to c.trace full_perm (initial_trace p)) (fun _ -> ());
intro_trace_until_init c v;
rewrite_slprop
(pts_to send half v `star` pts_to recv half v)
(pts_to c.send half v `star` pts_to c.recv half v)
(fun _ -> ());
intro_chan_inv #p c v;
let c' : chan_t_sr p send recv = c in
rewrite_slprop (chan_inv c) (chan_inv c') (fun _ -> ());
return c'
let new_chan (p:prot) : SteelT (chan p) emp (fun c -> sender c p `star` receiver c p)
= let q = msg unit p in
let v : chan_val = { chan_prot = q; chan_msg = (); chan_ctr = 0 } in
let vp : init_chan_val p = v in
let send = H.alloc v in
let recv = H.alloc v in
H.share recv;
H.share send;
(* TODO: use smt_fallback *)
rewrite_slprop (pts_to send (half_perm full_perm) v `star`
pts_to send (half_perm full_perm) v `star`
pts_to recv (half_perm full_perm) v `star`
pts_to recv (half_perm full_perm) v)
(pts_to send half vp `star`
pts_to send half vp `star`
pts_to recv half vp `star`
pts_to recv half vp)
(fun _ -> ());
let c = mk_chan send recv vp in
intro_in_state send p vp;
intro_in_state recv p vp;
let l = Steel.SpinLock.new_lock (chan_inv c) in
let ch = { chan_chan = c; chan_lock = l } in
rewrite_slprop (in_state send p) (sender ch p) (fun _ -> ());
rewrite_slprop (in_state recv p) (receiver ch p) (fun _ -> ());
return ch
[@@__reduce__]
let send_recv_in_sync (r:ref chan_val) (p:prot{more p}) #q (c:chan_t q) (vs vr:chan_val) : vprop =
(pts_to c.send half vs `star`
pts_to c.recv half vr `star`
trace_until c.trace vr `star`
pure (vs == vr) `star`
in_state r p)
[@@__reduce__]
let sender_ahead (r:ref chan_val) (p:prot{more p}) #q (c:chan_t q) (vs vr:chan_val) : vprop =
(pts_to c.send half vs `star`
pts_to c.recv half vr `star`
trace_until c.trace vr `star`
chan_inv_step vr vs `star`
in_state r p)
let update_channel (#p:sprot) #q (c:chan_t q) (x:msg_t p) (vs:chan_val) (r:ref chan_val)
: SteelT chan_val
(pts_to r full_perm vs `star` in_state_slprop p vs)
(fun vs' -> pts_to r full_perm vs' `star` (in_state_slprop (step p x) vs' `star` chan_inv_step vs vs'))
= elim_pure (in_state_prop p vs);
let vs' = next_chan_val x vs in
H.write r vs';
intro_pure (in_state_prop (step p x) vs');
intro_pure (chan_inv_step_p vs vs');
return vs'
[@@__reduce__]
let send_pre_available (p:sprot) #q (c:chan_t q) (vs vr:chan_val) = send_recv_in_sync c.send p c vs vr
let gather_r (#p:sprot) (r:ref chan_val) (v:chan_val)
: SteelT unit
(pts_to r half v `star` in_state r p)
(fun _ -> pts_to r full_perm v `star` in_state_slprop p v)
= let v' = witness_exists () in
H.higher_ref_pts_to_injective_eq #_ #_ #_ #_ #v #_ r;
H.gather #_ #_ #half #half #v #v r;
rewrite_slprop (pts_to r (sum_perm half half) v) (pts_to r full_perm v) (fun _ -> ());
rewrite_slprop (in_state_slprop p v') (in_state_slprop p v) (fun _ -> ())
let send_available (#p:sprot) #q (cc:chan q) (x:msg_t p) (vs vr:chan_val) (_:unit)
: SteelT unit (send_pre_available p #q cc.chan_chan vs vr) (fun _ -> sender cc (step p x))
= Steel.Utils.extract_pure (vs == vr);
Steel.Utils.rewrite #_ #(send_recv_in_sync cc.chan_chan.send p cc.chan_chan vs) vr vs;
elim_pure (vs == vs);
gather_r cc.chan_chan.send vs;
let next_vs = update_channel cc.chan_chan x vs cc.chan_chan.send in
H.share cc.chan_chan.send;
intro_exists next_vs (fun (next_vs:chan_val) -> pts_to cc.chan_chan.send half next_vs `star` in_state_slprop (step p x) next_vs);
intro_chan_inv_stepT cc.chan_chan next_vs vs;
Steel.SpinLock.release cc.chan_lock
let extensible (#p:prot) (x:partial_trace_of p) = P.more x.to
let next_msg_t (#p:prot) (x:partial_trace_of p) = P.next_msg_t x.to
let next_trace #p (vr:chan_val) (vs:chan_val)
(tr:partial_trace_of p)
(s:squash (until tr == step vr.chan_prot vr.chan_msg))
(_:squash (chan_inv_step_p vr vs))
: (ts:partial_trace_of p { until ts == step vs.chan_prot vs.chan_msg })
= let msg : next_msg_t tr = vs.chan_msg in
assert (extensible tr);
extend_partial_trace tr msg
let next_trace_st #p (vr:chan_val) (vs:chan_val) (tr:partial_trace_of p)
: Steel (extension_of tr)
(chan_inv_step vr vs)
(fun _ -> emp)
(requires fun _ -> until tr == step vr.chan_prot vr.chan_msg)
(ensures fun _ ts _ -> until ts == step vs.chan_prot vs.chan_msg)
= elim_pure (chan_inv_step_p vr vs);
let ts : extension_of tr = next_trace vr vs tr () () in
return ts
let update_trace #p (r:trace_ref p) (vr:chan_val) (vs:chan_val)
: Steel unit
(trace_until r vr)
(fun _ -> trace_until r vs)
(requires fun _ -> chan_inv_step_p vr vs)
(ensures fun _ _ _ -> True)
= intro_pure (chan_inv_step_p vr vs);
let tr = MRef.read_refine r in
elim_pure (until tr == step vr.chan_prot vr.chan_msg);
let ts : extension_of tr = next_trace_st vr vs tr in
MRef.write r ts;
intro_pure (until ts == step vs.chan_prot vs.chan_msg);
intro_exists ts
(fun (ts:partial_trace_of p) ->
MRef.pts_to r full_perm ts `star`
pure (until ts == step vs.chan_prot vs.chan_msg))
let recv_availableT (#p:sprot) #q (cc:chan q) (vs vr:chan_val) (_:unit)
: SteelT (msg_t p)
(sender_ahead cc.chan_chan.recv p cc.chan_chan vs vr)
(fun x -> receiver cc (step p x))
= elim_pure (chan_inv_step_p vr vs);
gather_r cc.chan_chan.recv vr;
elim_pure (in_state_prop p vr);
H.write cc.chan_chan.recv vs;
H.share cc.chan_chan.recv;
assert (vs.chan_prot == p);
let vs_msg : msg_t p = vs.chan_msg in
intro_pure (in_state_prop (step p vs_msg) vs);
intro_exists vs (fun (vs:chan_val) -> pts_to cc.chan_chan.recv half vs `star` in_state_slprop (step p vs_msg) vs);
update_trace cc.chan_chan.trace vr vs;
intro_chan_inv cc.chan_chan vs;
Steel.SpinLock.release cc.chan_lock;
vs_msg
#push-options "--ide_id_info_off"
let send_receive_prelude (#p:prot) (cc:chan p)
: SteelT (chan_val & chan_val)
emp
(fun v ->
pts_to cc.chan_chan.send half (fst v) `star`
pts_to cc.chan_chan.recv half (snd v) `star`
trace_until cc.chan_chan.trace (snd v) `star`
chan_inv_cond (fst v) (snd v))
= let c = cc.chan_chan in
Steel.SpinLock.acquire cc.chan_lock;
let vs = read_refine (chan_inv_recv cc.chan_chan) cc.chan_chan.send in
let _ = witness_exists () in
let vr = H.read cc.chan_chan.recv in
rewrite_slprop (trace_until _ _ `star` chan_inv_cond _ _)
(trace_until cc.chan_chan.trace vr `star` chan_inv_cond vs vr)
(fun _ -> ());
return (vs, vr)
let rec send (#p:prot) (c:chan p) (#next:prot{more next}) (x:msg_t next)
: SteelT unit (sender c next) (fun _ -> sender c (step next x))
= let v = send_receive_prelude c in //matching v as vs,vr fails
if (fst v).chan_ctr = (snd v).chan_ctr
then (
rewrite_slprop (chan_inv_cond (fst v) (snd v))
(pure (fst v == snd v))
(fun _ -> ());
send_available c x (fst v) (snd v) () //TODO: inlining send_availableT here fails
)
else (
rewrite_slprop (chan_inv_cond (fst v) (snd v))
(chan_inv_step (snd v) (fst v))
(fun _ -> ());
intro_chan_inv_stepT c.chan_chan (fst v) (snd v);
Steel.SpinLock.release c.chan_lock;
send c x
)
let rec recv (#p:prot) (#next:prot{more next}) (c:chan p)
: SteelT (msg_t next) (receiver c next) (fun x -> receiver c (step next x))
= let v = send_receive_prelude c in
if (fst v).chan_ctr = (snd v).chan_ctr
then (
rewrite_slprop (chan_inv_cond (fst v) (snd v))
(pure (fst v == snd v))
(fun _ -> ());
elim_pure (fst v == snd v);
intro_chan_inv_eqT c.chan_chan (fst v) (snd v);
Steel.SpinLock.release c.chan_lock;
recv c
)
else (
rewrite_slprop (chan_inv_cond (fst v) (snd v))
(chan_inv_step (snd v) (fst v))
(fun _ -> ());
recv_availableT c (fst v) (snd v) ()
)
let history_p' (#p:prot) (t:partial_trace_of p) (s:partial_trace_of p) : prop =
t `extended_to` s /\ True
let history_p (#p:prot) (t:partial_trace_of p) : MRef.stable_property extended_to =
history_p' t
let history (#p:prot) (c:chan p) (t:partial_trace_of p) : Type0 =
MRef.witnessed c.chan_chan.trace (history_p t)
let recall_trace_ref #q (r:trace_ref q) (tr tr':partial_trace_of q)
(tok:MRef.witnessed r (history_p tr))
: Steel unit
(MRef.pts_to r full_perm tr')
(fun _ -> MRef.pts_to r full_perm tr')
(requires fun _ -> True)
(ensures fun _ _ _ -> history_p tr tr')
= MRef.recall (history_p tr) r tr' tok
let prot_equals #q (#p:_) (#vr:chan_val) (cc:chan q)
: Steel unit
(pts_to cc.chan_chan.recv half vr `star` receiver cc p)
(fun _ -> pts_to cc.chan_chan.recv half vr `star` receiver cc p)
(requires fun _ -> True)
(ensures fun _ _ _ -> step vr.chan_prot vr.chan_msg == p)
= let vr' = witness_exists () in
H.higher_ref_pts_to_injective_eq #_ #_ #_ #_ #vr #_ cc.chan_chan.recv;
rewrite_slprop (in_state_slprop _ _) (in_state_slprop p vr) (fun _ -> ());
elim_pure _;
intro_in_state _ _ vr
let witness_trace_until #q (#vr:chan_val) (r:trace_ref q)
: SteelT (tr:partial_trace_of q & MRef.witnessed r (history_p tr))
(trace_until r vr)
(fun _ -> trace_until r vr)
= let tr = MRef.read_refine r in
let tok = MRef.witness r (history_p tr) tr () in
elim_pure (until tr == step vr.chan_prot vr.chan_msg);
intro_trace_until r tr vr;
(| tr, tok |)
let trace #q (cc:chan q)
: SteelT (tr:partial_trace_of q & history cc tr)
emp (fun _ -> emp)
= let _ = send_receive_prelude cc in
let tr = witness_trace_until cc.chan_chan.trace in
intro_chan_inv_auxT cc.chan_chan;
Steel.SpinLock.release cc.chan_lock;
tr | {
"checked_file": "/",
"dependencies": [
"Steel.Utils.fst.checked",
"Steel.SpinLock.fsti.checked",
"Steel.MonotonicHigherReference.fsti.checked",
"Steel.Memory.fsti.checked",
"Steel.HigherReference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"Steel.Channel.Protocol.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Channel.Simplex.fst"
} | [
{
"abbrev": true,
"full_module": "Steel.HigherReference",
"short_module": "H"
},
{
"abbrev": true,
"full_module": "Steel.MonotonicHigherReference",
"short_module": "MRef"
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.HigherReference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.SpinLock",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Channel.Protocol",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Channel.Protocol",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Channel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Channel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | c: Steel.Channel.Simplex.chan q -> tok: Steel.Channel.Simplex.history c tr
-> Steel.Effect.Steel
(Prims.dtuple2 (Steel.Channel.Protocol.extension_of tr)
(fun tr' -> Steel.Channel.Simplex.history c tr')) | Steel.Effect.Steel | [] | [] | [
"Steel.Channel.Protocol.protocol",
"Prims.unit",
"Steel.Channel.Protocol.partial_trace_of",
"Steel.Channel.Simplex.chan_val",
"Steel.Channel.Simplex.chan",
"Steel.Channel.Simplex.history",
"Prims.Mkdtuple2",
"Steel.Channel.Protocol.extension_of",
"Prims.dtuple2",
"Steel.Channel.Simplex.intro_trace_until",
"Steel.Channel.Simplex.__proj__Mkchan_t__item__trace",
"Steel.Channel.Simplex.__proj__Mkchan__item__chan_chan",
"Steel.Effect.Atomic.elim_pure",
"FStar.Ghost.hide",
"FStar.Set.set",
"Steel.Memory.iname",
"FStar.Set.empty",
"Prims.eq2",
"Steel.Channel.Protocol.until",
"Steel.Channel.Simplex.step",
"Steel.Channel.Simplex.__proj__Mkchan_val__item__chan_prot",
"Steel.Channel.Simplex.__proj__Mkchan_val__item__chan_msg",
"Steel.MonotonicHigherReference.witnessed",
"Steel.Channel.Protocol.extended_to",
"FStar.Ghost.reveal",
"Steel.MonotonicHigherReference.ref",
"Steel.Channel.Simplex.history_p",
"Steel.MonotonicHigherReference.witness",
"Steel.FractionalPermission.full_perm",
"Steel.Channel.Simplex.recall_trace_ref",
"Steel.MonotonicHigherReference.read_refine",
"Steel.Effect.Common.pure",
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.star",
"Steel.HigherReference.pts_to",
"Steel.Channel.Simplex.__proj__Mkchan_t__item__recv",
"Steel.Channel.Simplex.half",
"Steel.Channel.Simplex.trace_until",
"Steel.Effect.Common.rmem",
"Prims.l_True",
"FStar.Pervasives.dfst"
] | [] | false | true | false | false | false | let extend_history #q (#tr: partial_trace_of q) (#v: chan_val) (c: chan q) (tok: history c tr)
: Steel (tr': extension_of tr & history c tr')
((pts_to c.chan_chan.recv half v) `star` (trace_until c.chan_chan.trace v))
(fun _ -> (pts_to c.chan_chan.recv half v) `star` (trace_until c.chan_chan.trace v))
(requires fun _ -> True)
(ensures fun _ tr' _ -> until (dfst tr') == step v.chan_prot v.chan_msg) =
| let tr' = MRef.read_refine c.chan_chan.trace in
let _ = recall_trace_ref c.chan_chan.trace tr tr' tok in
let tok' = MRef.witness c.chan_chan.trace (history_p tr') tr' () in
elim_pure (until tr' == step v.chan_prot v.chan_msg);
intro_trace_until c.chan_chan.trace tr' v;
let tr'':extension_of tr = tr' in
(| tr'', tok' |) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_lemma_Fast_add | val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) | val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) | let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 16,
"end_line": 1130,
"start_col": 0,
"start_line": 1087
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64 ->
inB_b: Vale.X64.Memory.buffer64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | Prims.Ghost | [] | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Memory.buffer64",
"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_mem_heaplet",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Machine_s.rRax",
"Vale.X64.QuickCode.va_Mod_ok",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.list",
"Vale.X64.QuickCode.__proj__QProc__item__mods",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_add",
"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.int",
"Prims.op_Addition",
"Vale.X64.Decls.validSrcAddrs64",
"Vale.X64.Decls.va_get_mem_heaplet",
"Vale.X64.Decls.va_get_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Decls.va_get_mem_layout",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.Decls.modifies_buffer",
"Prims.nat",
"Vale.Curve25519.Fast_defs.pow2_five",
"Vale.Def.Words_s.nat64",
"Vale.X64.Decls.buffer64_read",
"Vale.Curve25519.Fast_defs.pow2_four",
"Vale.X64.QuickCode.quickCode",
"Vale.Curve25519.X64.FastUtil.va_qcode_Fast_add"
] | [] | false | false | false | false | false | let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
| let va_mods:va_mods_t =
[
va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem
]
in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let va_sM, va_fM, va_g =
va_wp_sound_code_norm (va_code_Fast_add ())
va_qc
va_s0
(fun va_s0 va_sM va_g ->
let () = va_g in
label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\
(let a0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in
let a1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in
let a2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0)
in
let a3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in
let b0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in
let b1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in
let b2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0)
in
let b3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0)
in
let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
let b:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)
in
label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d =
Vale.Curve25519.Fast_defs.pow2_five d0
d1
d2
d3
(va_get_reg64 rRax va_sM)
in
label va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM)
dst_b
4
(va_get_mem_layout va_sM)
Secret) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0)
(va_get_mem_heaplet 0 va_sM)))))))))
in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([
va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem
])
va_sM
va_s0;
(va_sM, va_fM) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_wpProof_Cswap2_stdcall | val va_wpProof_Cswap2_stdcall : win:bool -> bit_in:nat64 -> p0_b:buffer64 -> p1_b:buffer64 ->
va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cswap2_stdcall win bit_in p0_b p1_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cswap2_stdcall win)
([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRdi;
va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) | val va_wpProof_Cswap2_stdcall : win:bool -> bit_in:nat64 -> p0_b:buffer64 -> p1_b:buffer64 ->
va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cswap2_stdcall win bit_in p0_b p1_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cswap2_stdcall win)
([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRdi;
va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) | let va_wpProof_Cswap2_stdcall win bit_in p0_b p1_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cswap2_stdcall (va_code_Cswap2_stdcall win) va_s0 win bit_in p0_b
p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRsp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM
(va_update_reg64 rRdx va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 22,
"end_line": 2199,
"start_col": 0,
"start_line": 2186
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub dst_b inA_b inB_b) (va_wpProof_Fast_sub dst_b inA_b inB_b))
#pop-options
//--
//-- Cswap_single
val va_code_Cswap_single : offset:nat -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap_single offset =
(va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 +
offset `op_Multiply` 8) Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_CNil ())))))))))
val va_codegen_success_Cswap_single : offset:nat -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap_single offset =
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_ttrue ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap_single (va_mods:va_mods_t) (offset:nat) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap_single offset)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 839 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 840 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 841 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 842 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 843 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 844 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi)
(va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 845 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdx)
(va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QEmpty
(()))))))))))
val va_lemma_Cswap_single : va_b0:va_code -> va_s0:va_state -> offset:nat -> p0_b:buffer64 ->
p1_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cswap_single offset) va_s0 /\ va_get_ok va_s0 /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p1_val else old_p0_val) /\ p1_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p0_val else old_p1_val))) /\ va_state_eq va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))
[@"opaque_to_smt"]
let va_lemma_Cswap_single va_b0 va_s0 offset p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap_single va_mods offset p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap_single offset) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 792 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 821 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 822 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdx va_sM) p1_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 824 column 57 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 832 column 59 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read p0_b i
(va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet 0
va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 834 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_val = Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 835 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_val = Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 836 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ ->
old_p0_val)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 837 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ ->
old_p1_val)))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
(0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall
(va_x_mem:vale_heap) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_heap0:vale_heap) .
let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9
va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_mem va_x_mem va_s0)))) in va_get_ok va_sM /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == va_if
(Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ -> old_p0_val) /\ p1_val
== va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ -> old_p1_val)))
==> va_k va_sM (())))
val va_wpProof_Cswap_single : offset:nat -> p0_b:buffer64 -> p1_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cswap_single offset p0_b p1_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cswap_single offset)
([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Cswap_single offset p0_b p1_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cswap_single (va_code_Cswap_single offset) va_s0 offset p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))));
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) : (va_quickCode unit
(va_code_Cswap_single offset)) =
(va_QProc (va_code_Cswap_single offset) ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_mem]) (va_wp_Cswap_single offset p0_b p1_b)
(va_wpProof_Cswap_single offset p0_b p1_b))
//--
//-- Cswap2
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap2 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Transfer bit into CF flag"
) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[0], p2[0]"
) (va_CCons (va_code_Cswap_single 0) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[1], p2[1]"
) (va_CCons (va_code_Cswap_single 1) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[2], p2[2]"
) (va_CCons (va_code_Cswap_single 2) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[3], p2[3]"
) (va_CCons (va_code_Cswap_single 3) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[4], p2[4]"
) (va_CCons (va_code_Cswap_single 4) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[5], p2[5]"
) (va_CCons (va_code_Cswap_single 5) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[6], p2[6]"
) (va_CCons (va_code_Cswap_single 6) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[7], p2[7]"
) (va_CCons (va_code_Cswap_single 7) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil
()))))))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap2 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Transfer bit into CF flag"
) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64
18446744073709551615)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and
(va_codegen_success_Comment
"cswap p1[0], p2[0]"
) (va_pbool_and (va_codegen_success_Cswap_single 0) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[1], p2[1]"
) (va_pbool_and (va_codegen_success_Cswap_single 1) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[2], p2[2]"
) (va_pbool_and (va_codegen_success_Cswap_single 2) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[3], p2[3]"
) (va_pbool_and (va_codegen_success_Cswap_single 3) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[4], p2[4]"
) (va_pbool_and (va_codegen_success_Cswap_single 4) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[5], p2[5]"
) (va_pbool_and (va_codegen_success_Cswap_single 5) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[6], p2[6]"
) (va_pbool_and (va_codegen_success_Cswap_single 6) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[7], p2[7]"
) (va_pbool_and (va_codegen_success_Cswap_single 7) (va_pbool_and
(va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap2 (va_mods:va_mods_t) (bit_in:nat64) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap2 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 0 (va_get_mem va_s) in
let (old_p0_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 1 (va_get_mem va_s)
in let (old_p0_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem
va_s) in let (old_p0_3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 3
(va_get_mem va_s) in let (old_p0_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
4 (va_get_mem va_s) in let (old_p0_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b 5 (va_get_mem va_s) in let (old_p0_6:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_s) in let (old_p0_7:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem va_s) in let
(old_p1_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 0 (va_get_mem va_s) in
let (old_p1_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 1 (va_get_mem va_s)
in let (old_p1_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem
va_s) in let (old_p1_3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 3
(va_get_mem va_s) in let (old_p1_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b
4 (va_get_mem va_s) in let (old_p1_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p1_b 5 (va_get_mem va_s) in let (old_p1_6:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_s) in let (old_p1_7:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 932 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 p0_b 0 Secret Mutable; declare_buffer64 p1_b 0
Secret Mutable])) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 936 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Transfer bit into CF flag"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 937 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64 18446744073709551615))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 939 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 940 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[0], p2[0]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 941 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 0 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 943 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 944 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[1], p2[1]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 945 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 1 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 947 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 948 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[2], p2[2]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 949 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 2 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 951 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 952 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[3], p2[3]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 953 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 3 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 955 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 956 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[4], p2[4]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 957 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 4 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 959 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 960 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[5], p2[5]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 961 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 5 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 963 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 964 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[6], p2[6]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 965 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 6 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 967 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 968 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[7], p2[7]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 969 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 7 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 971 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Cswap2 va_b0 va_s0 bit_in p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdi; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap2 va_mods bit_in p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap2 ()) va_qc va_s0 (fun va_s0 va_sM
va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 848 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
0 (va_get_mem va_s0) in let (old_p0_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b 1 (va_get_mem va_s0) in let (old_p0_2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem va_s0) in let (old_p0_3:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p0_b 3 (va_get_mem va_s0) in let
(old_p0_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 4 (va_get_mem va_s0) in
let (old_p0_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 5 (va_get_mem va_s0)
in let (old_p0_6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem
va_s0) in let (old_p0_7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 7
(va_get_mem va_s0) in let (old_p1_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b
0 (va_get_mem va_s0) in let (old_p1_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p1_b 1 (va_get_mem va_s0) in let (old_p1_2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem va_s0) in let (old_p1_3:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p1_b 3 (va_get_mem va_s0) in let
(old_p1_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 4 (va_get_mem va_s0) in
let (old_p1_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 5 (va_get_mem va_s0)
in let (old_p1_6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem
va_s0) in let (old_p1_7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 7
(va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 894 column 53 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_0 = Vale.X64.Decls.buffer64_read p0_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 897 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_1 = Vale.X64.Decls.buffer64_read p0_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 898 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_2 = Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 899 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_3 = Vale.X64.Decls.buffer64_read p0_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 900 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_4 = Vale.X64.Decls.buffer64_read p0_b 4 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 901 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_5 = Vale.X64.Decls.buffer64_read p0_b 5 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 902 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_6 = Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 903 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_7 = Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 905 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_0 = Vale.X64.Decls.buffer64_read p1_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 906 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_1 = Vale.X64.Decls.buffer64_read p1_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 907 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_2 = Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 908 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_3 = Vale.X64.Decls.buffer64_read p1_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 909 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_4 = Vale.X64.Decls.buffer64_read p1_b 4 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 910 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_5 = Vale.X64.Decls.buffer64_read p1_b 5 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 911 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_6 = Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 912 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_7 = Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 914 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_0 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_0) (fun _ -> old_p0_0)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 915 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_1 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_1) (fun _ -> old_p0_1)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 916 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_2 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_2) (fun _ -> old_p0_2)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 917 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_3 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_3) (fun _ -> old_p0_3)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 918 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_4 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_4) (fun _ -> old_p0_4)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 919 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_5 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_5) (fun _ -> old_p0_5)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 920 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_6 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_6) (fun _ -> old_p0_6)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 921 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_7 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_7) (fun _ -> old_p0_7)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 923 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_0 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_0) (fun _ -> old_p1_0)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 924 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_1 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_1) (fun _ -> old_p1_1)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 925 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_2 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_2) (fun _ -> old_p1_2)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 926 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_3 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_3) (fun _ -> old_p1_3)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 927 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_4 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_4) (fun _ -> old_p1_4)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 928 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_5 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_5) (fun _ -> old_p1_5)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 929 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_6 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_6) (fun _ -> old_p1_6)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 930 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_7 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_7) (fun _ ->
old_p1_7)))))))))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdi; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cswap2 bit_in p0_b p1_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cswap2 (va_code_Cswap2 ()) va_s0 bit_in p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM
(va_update_flags va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64
rR8 va_sM (va_update_reg64 rRdi va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdi; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cswap2_stdcall
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap2_stdcall win =
(va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64
rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil
())) (va_CCons (va_code_Cswap2 ()) (va_CCons (if win then va_Block (va_CCons
(va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret
(va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ())))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap2_stdcall win =
(va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64
rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Cswap2 ()) (va_pbool_and
(if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi))
(va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else
va_ttrue ()) (va_ttrue ()))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap2_stdcall (va_mods:va_mods_t) (win:bool) (bit_in:nat64) (p0_b:buffer64)
(p1_b:buffer64) : (va_quickCode unit (va_code_Cswap2_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(p0_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s)
(fun _ -> va_get_reg64 rRsi va_s) in let (p1_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in let
(old_p0_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 0 (va_get_mem va_s) in
let (old_p0_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 1 (va_get_mem va_s)
in let (old_p0_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem
va_s) in let (old_p0_3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 3
(va_get_mem va_s) in let (old_p0_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
4 (va_get_mem va_s) in let (old_p0_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b 5 (va_get_mem va_s) in let (old_p0_6:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_s) in let (old_p0_7:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem va_s) in let
(old_p1_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 0 (va_get_mem va_s) in
let (old_p1_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 1 (va_get_mem va_s)
in let (old_p1_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem
va_s) in let (old_p1_3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 3
(va_get_mem va_s) in let (old_p1_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b
4 (va_get_mem va_s) in let (old_p1_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p1_b 5 (va_get_mem va_s) in let (old_p1_6:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_s) in let (old_p1_7:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 1067 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1070 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1071 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1072 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1073 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1074 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 1077 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap2 bit_in p0_b p1_b) (fun (va_s:va_state) _ -> va_QBind va_range1
"***** PRECONDITION NOT MET AT line 1079 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1081 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1082 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun
(va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))))
[@"opaque_to_smt"]
let va_lemma_Cswap2_stdcall va_b0 va_s0 win bit_in p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap2_stdcall va_mods win bit_in p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap2_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 974 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (p0_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (p1_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64
rRdx va_s0) in let (old_p0_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 0
(va_get_mem va_s0) in let (old_p0_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
1 (va_get_mem va_s0) in let (old_p0_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b 2 (va_get_mem va_s0) in let (old_p0_3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p0_b 3 (va_get_mem va_s0) in let (old_p0_4:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p0_b 4 (va_get_mem va_s0) in let
(old_p0_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 5 (va_get_mem va_s0) in
let (old_p0_6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_s0)
in let (old_p0_7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem
va_s0) in let (old_p1_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 0
(va_get_mem va_s0) in let (old_p1_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b
1 (va_get_mem va_s0) in let (old_p1_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p1_b 2 (va_get_mem va_s0) in let (old_p1_3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b 3 (va_get_mem va_s0) in let (old_p1_4:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p1_b 4 (va_get_mem va_s0) in let
(old_p1_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 5 (va_get_mem va_s0) in
let (old_p1_6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_s0)
in let (old_p1_7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem
va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 1021 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_0 = Vale.X64.Decls.buffer64_read p0_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 1022 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_1 = Vale.X64.Decls.buffer64_read p0_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 1023 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_2 = Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 1024 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_3 = Vale.X64.Decls.buffer64_read p0_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 1025 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_4 = Vale.X64.Decls.buffer64_read p0_b 4 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 1026 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_5 = Vale.X64.Decls.buffer64_read p0_b 5 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 1027 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_6 = Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 1028 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_7 = Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 1030 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_0 = Vale.X64.Decls.buffer64_read p1_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 1031 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_1 = Vale.X64.Decls.buffer64_read p1_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 1032 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_2 = Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 1033 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_3 = Vale.X64.Decls.buffer64_read p1_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 1034 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_4 = Vale.X64.Decls.buffer64_read p1_b 4 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 1035 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_5 = Vale.X64.Decls.buffer64_read p1_b 5 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 1036 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_6 = Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 1037 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_7 = Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 1039 column 65 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_0 == va_if (bit_in = 1) (fun _ -> old_p1_0) (fun _ -> old_p0_0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1040 column 65 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_1 == va_if (bit_in = 1) (fun _ -> old_p1_1) (fun _ -> old_p0_1)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1041 column 65 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_2 == va_if (bit_in = 1) (fun _ -> old_p1_2) (fun _ -> old_p0_2)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1042 column 65 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_3 == va_if (bit_in = 1) (fun _ -> old_p1_3) (fun _ -> old_p0_3)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1043 column 65 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_4 == va_if (bit_in = 1) (fun _ -> old_p1_4) (fun _ -> old_p0_4)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1044 column 65 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_5 == va_if (bit_in = 1) (fun _ -> old_p1_5) (fun _ -> old_p0_5)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1045 column 65 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_6 == va_if (bit_in = 1) (fun _ -> old_p1_6) (fun _ -> old_p0_6)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1046 column 65 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_7 == va_if (bit_in = 1) (fun _ -> old_p1_7) (fun _ -> old_p0_7)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1048 column 65 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_0 == va_if (bit_in = 1) (fun _ -> old_p0_0) (fun _ -> old_p1_0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1049 column 65 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_1 == va_if (bit_in = 1) (fun _ -> old_p0_1) (fun _ -> old_p1_1)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1050 column 65 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_2 == va_if (bit_in = 1) (fun _ -> old_p0_2) (fun _ -> old_p1_2)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1051 column 65 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_3 == va_if (bit_in = 1) (fun _ -> old_p0_3) (fun _ -> old_p1_3)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1052 column 65 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_4 == va_if (bit_in = 1) (fun _ -> old_p0_4) (fun _ -> old_p1_4)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1053 column 65 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_5 == va_if (bit_in = 1) (fun _ -> old_p0_5) (fun _ -> old_p1_5)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1054 column 65 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_6 == va_if (bit_in = 1) (fun _ -> old_p0_6) (fun _ -> old_p1_6)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1055 column 65 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_7 == va_if (bit_in = 1) (fun _ -> old_p0_7) (fun _ -> old_p1_7)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1060 column 53 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 1062 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1063 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 1064 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
win: Prims.bool ->
bit_in: Vale.X64.Memory.nat64 ->
p0_b: Vale.X64.Memory.buffer64 ->
p1_b: Vale.X64.Memory.buffer64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | Prims.Ghost | [] | [] | [
"Prims.bool",
"Vale.X64.Memory.nat64",
"Vale.X64.Memory.buffer64",
"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_stackTaint",
"Vale.X64.QuickCode.va_Mod_stack",
"Vale.X64.QuickCode.va_Mod_mem_layout",
"Vale.X64.QuickCode.va_Mod_mem_heaplet",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Machine_s.rRsp",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rRsi",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_stackTaint",
"Vale.X64.Decls.va_update_stack",
"Vale.X64.Decls.va_update_mem_layout",
"Vale.X64.Decls.va_update_mem_heaplet",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_mem",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.Curve25519.X64.FastUtil.va_lemma_Cswap2_stdcall",
"Vale.Curve25519.X64.FastUtil.va_code_Cswap2_stdcall"
] | [] | false | false | false | false | false | let va_wpProof_Cswap2_stdcall win bit_in p0_b p1_b va_s0 va_k =
| let va_sM, va_f0 =
va_lemma_Cswap2_stdcall (va_code_Cswap2_stdcall win) va_s0 win bit_in p0_b p1_b
in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_stackTaint va_sM
(va_update_stack va_sM
(va_update_mem_layout va_sM
(va_update_mem_heaplet 0
va_sM
(va_update_flags va_sM
(va_update_reg64 rR10
va_sM
(va_update_reg64 rR9
va_sM
(va_update_reg64 rR8
va_sM
(va_update_reg64 rRsp
va_sM
(va_update_reg64 rRdi
va_sM
(va_update_reg64 rRsi
va_sM
(va_update_reg64 rRdx
va_sM
(va_update_ok va_sM
(va_update_mem va_sM va_s0)))))))))))))));
va_lemma_norm_mods ([
va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRdi;
va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_mem
])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | false |
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_wpProof_Cswap2 | val va_wpProof_Cswap2 : bit_in:nat64 -> p0_b:buffer64 -> p1_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cswap2 bit_in p0_b p1_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cswap2 ()) ([va_Mod_mem_layout;
va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRdi; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) | val va_wpProof_Cswap2 : bit_in:nat64 -> p0_b:buffer64 -> p1_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cswap2 bit_in p0_b p1_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cswap2 ()) ([va_Mod_mem_layout;
va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRdi; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) | let va_wpProof_Cswap2 bit_in p0_b p1_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cswap2 (va_code_Cswap2 ()) va_s0 bit_in p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM
(va_update_flags va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64
rR8 va_sM (va_update_reg64 rRdi va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdi; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 22,
"end_line": 1995,
"start_col": 0,
"start_line": 1986
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub dst_b inA_b inB_b) (va_wpProof_Fast_sub dst_b inA_b inB_b))
#pop-options
//--
//-- Cswap_single
val va_code_Cswap_single : offset:nat -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap_single offset =
(va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 +
offset `op_Multiply` 8) Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_CNil ())))))))))
val va_codegen_success_Cswap_single : offset:nat -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap_single offset =
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_ttrue ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap_single (va_mods:va_mods_t) (offset:nat) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap_single offset)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 839 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 840 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 841 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 842 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 843 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 844 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi)
(va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 845 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdx)
(va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QEmpty
(()))))))))))
val va_lemma_Cswap_single : va_b0:va_code -> va_s0:va_state -> offset:nat -> p0_b:buffer64 ->
p1_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cswap_single offset) va_s0 /\ va_get_ok va_s0 /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p1_val else old_p0_val) /\ p1_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p0_val else old_p1_val))) /\ va_state_eq va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))
[@"opaque_to_smt"]
let va_lemma_Cswap_single va_b0 va_s0 offset p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap_single va_mods offset p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap_single offset) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 792 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 821 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 822 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdx va_sM) p1_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 824 column 57 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 832 column 59 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read p0_b i
(va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet 0
va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 834 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_val = Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 835 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_val = Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 836 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ ->
old_p0_val)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 837 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ ->
old_p1_val)))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
(0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall
(va_x_mem:vale_heap) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_heap0:vale_heap) .
let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9
va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_mem va_x_mem va_s0)))) in va_get_ok va_sM /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == va_if
(Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ -> old_p0_val) /\ p1_val
== va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ -> old_p1_val)))
==> va_k va_sM (())))
val va_wpProof_Cswap_single : offset:nat -> p0_b:buffer64 -> p1_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cswap_single offset p0_b p1_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cswap_single offset)
([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Cswap_single offset p0_b p1_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cswap_single (va_code_Cswap_single offset) va_s0 offset p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))));
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) : (va_quickCode unit
(va_code_Cswap_single offset)) =
(va_QProc (va_code_Cswap_single offset) ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_mem]) (va_wp_Cswap_single offset p0_b p1_b)
(va_wpProof_Cswap_single offset p0_b p1_b))
//--
//-- Cswap2
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap2 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Transfer bit into CF flag"
) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[0], p2[0]"
) (va_CCons (va_code_Cswap_single 0) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[1], p2[1]"
) (va_CCons (va_code_Cswap_single 1) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[2], p2[2]"
) (va_CCons (va_code_Cswap_single 2) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[3], p2[3]"
) (va_CCons (va_code_Cswap_single 3) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[4], p2[4]"
) (va_CCons (va_code_Cswap_single 4) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[5], p2[5]"
) (va_CCons (va_code_Cswap_single 5) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[6], p2[6]"
) (va_CCons (va_code_Cswap_single 6) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[7], p2[7]"
) (va_CCons (va_code_Cswap_single 7) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil
()))))))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap2 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Transfer bit into CF flag"
) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64
18446744073709551615)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and
(va_codegen_success_Comment
"cswap p1[0], p2[0]"
) (va_pbool_and (va_codegen_success_Cswap_single 0) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[1], p2[1]"
) (va_pbool_and (va_codegen_success_Cswap_single 1) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[2], p2[2]"
) (va_pbool_and (va_codegen_success_Cswap_single 2) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[3], p2[3]"
) (va_pbool_and (va_codegen_success_Cswap_single 3) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[4], p2[4]"
) (va_pbool_and (va_codegen_success_Cswap_single 4) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[5], p2[5]"
) (va_pbool_and (va_codegen_success_Cswap_single 5) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[6], p2[6]"
) (va_pbool_and (va_codegen_success_Cswap_single 6) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[7], p2[7]"
) (va_pbool_and (va_codegen_success_Cswap_single 7) (va_pbool_and
(va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap2 (va_mods:va_mods_t) (bit_in:nat64) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap2 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 0 (va_get_mem va_s) in
let (old_p0_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 1 (va_get_mem va_s)
in let (old_p0_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem
va_s) in let (old_p0_3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 3
(va_get_mem va_s) in let (old_p0_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
4 (va_get_mem va_s) in let (old_p0_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b 5 (va_get_mem va_s) in let (old_p0_6:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_s) in let (old_p0_7:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem va_s) in let
(old_p1_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 0 (va_get_mem va_s) in
let (old_p1_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 1 (va_get_mem va_s)
in let (old_p1_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem
va_s) in let (old_p1_3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 3
(va_get_mem va_s) in let (old_p1_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b
4 (va_get_mem va_s) in let (old_p1_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p1_b 5 (va_get_mem va_s) in let (old_p1_6:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_s) in let (old_p1_7:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 932 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 p0_b 0 Secret Mutable; declare_buffer64 p1_b 0
Secret Mutable])) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 936 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Transfer bit into CF flag"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 937 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64 18446744073709551615))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 939 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 940 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[0], p2[0]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 941 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 0 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 943 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 944 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[1], p2[1]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 945 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 1 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 947 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 948 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[2], p2[2]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 949 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 2 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 951 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 952 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[3], p2[3]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 953 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 3 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 955 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 956 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[4], p2[4]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 957 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 4 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 959 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 960 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[5], p2[5]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 961 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 5 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 963 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 964 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[6], p2[6]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 965 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 6 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 967 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 968 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[7], p2[7]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 969 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 7 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 971 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Cswap2 va_b0 va_s0 bit_in p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdi; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap2 va_mods bit_in p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap2 ()) va_qc va_s0 (fun va_s0 va_sM
va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 848 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
0 (va_get_mem va_s0) in let (old_p0_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b 1 (va_get_mem va_s0) in let (old_p0_2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem va_s0) in let (old_p0_3:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p0_b 3 (va_get_mem va_s0) in let
(old_p0_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 4 (va_get_mem va_s0) in
let (old_p0_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 5 (va_get_mem va_s0)
in let (old_p0_6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem
va_s0) in let (old_p0_7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 7
(va_get_mem va_s0) in let (old_p1_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b
0 (va_get_mem va_s0) in let (old_p1_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p1_b 1 (va_get_mem va_s0) in let (old_p1_2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem va_s0) in let (old_p1_3:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p1_b 3 (va_get_mem va_s0) in let
(old_p1_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 4 (va_get_mem va_s0) in
let (old_p1_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 5 (va_get_mem va_s0)
in let (old_p1_6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem
va_s0) in let (old_p1_7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 7
(va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 894 column 53 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_0 = Vale.X64.Decls.buffer64_read p0_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 897 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_1 = Vale.X64.Decls.buffer64_read p0_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 898 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_2 = Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 899 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_3 = Vale.X64.Decls.buffer64_read p0_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 900 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_4 = Vale.X64.Decls.buffer64_read p0_b 4 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 901 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_5 = Vale.X64.Decls.buffer64_read p0_b 5 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 902 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_6 = Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 903 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_7 = Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 905 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_0 = Vale.X64.Decls.buffer64_read p1_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 906 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_1 = Vale.X64.Decls.buffer64_read p1_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 907 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_2 = Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 908 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_3 = Vale.X64.Decls.buffer64_read p1_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 909 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_4 = Vale.X64.Decls.buffer64_read p1_b 4 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 910 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_5 = Vale.X64.Decls.buffer64_read p1_b 5 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 911 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_6 = Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 912 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_7 = Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 914 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_0 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_0) (fun _ -> old_p0_0)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 915 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_1 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_1) (fun _ -> old_p0_1)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 916 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_2 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_2) (fun _ -> old_p0_2)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 917 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_3 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_3) (fun _ -> old_p0_3)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 918 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_4 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_4) (fun _ -> old_p0_4)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 919 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_5 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_5) (fun _ -> old_p0_5)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 920 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_6 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_6) (fun _ -> old_p0_6)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 921 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_7 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_7) (fun _ -> old_p0_7)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 923 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_0 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_0) (fun _ -> old_p1_0)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 924 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_1 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_1) (fun _ -> old_p1_1)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 925 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_2 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_2) (fun _ -> old_p1_2)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 926 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_3 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_3) (fun _ -> old_p1_3)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 927 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_4 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_4) (fun _ -> old_p1_4)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 928 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_5 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_5) (fun _ -> old_p1_5)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 929 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_6 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_6) (fun _ -> old_p1_6)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 930 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_7 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_7) (fun _ ->
old_p1_7)))))))))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdi; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
bit_in: Vale.X64.Memory.nat64 ->
p0_b: Vale.X64.Memory.buffer64 ->
p1_b: Vale.X64.Memory.buffer64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | Prims.Ghost | [] | [] | [
"Vale.X64.Memory.nat64",
"Vale.X64.Memory.buffer64",
"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_mem_layout",
"Vale.X64.QuickCode.va_Mod_mem_heaplet",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_mem_layout",
"Vale.X64.Decls.va_update_mem_heaplet",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_mem",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.Curve25519.X64.FastUtil.va_lemma_Cswap2",
"Vale.Curve25519.X64.FastUtil.va_code_Cswap2"
] | [] | false | false | false | false | false | let va_wpProof_Cswap2 bit_in p0_b p1_b va_s0 va_k =
| let va_sM, va_f0 = va_lemma_Cswap2 (va_code_Cswap2 ()) va_s0 bit_in p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_mem_layout va_sM
(va_update_mem_heaplet 0
va_sM
(va_update_flags va_sM
(va_update_reg64 rR10
va_sM
(va_update_reg64 rR9
va_sM
(va_update_reg64 rR8
va_sM
(va_update_reg64 rRdi
va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([
va_Mod_mem_layout;
va_Mod_mem_heaplet 0;
va_Mod_flags;
va_Mod_reg64 rR10;
va_Mod_reg64 rR9;
va_Mod_reg64 rR8;
va_Mod_reg64 rRdi;
va_Mod_mem
])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | false |
MiniValeSemantics.fst | MiniValeSemantics.pow2_64 | val pow2_64 : Prims.int | let pow2_64 = 0x10000000000000000 | {
"file_name": "examples/metatheory/MiniValeSemantics.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 33,
"end_line": 35,
"start_col": 0,
"start_line": 35
} | (*
Copyright 2008-2019 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.
Authors: C. Hawblitzel, N. Swamy
*)
module MiniValeSemantics
(*
This is a highly-simplified model of Vale/F*, based on Section
3.1-3.3 of the paper of the POPL '19 paper.
It is derived from the QuickRegs1 code in the popl-artifact-submit
branch of Vale.
*)
/// We use this tag to mark certain definitions
/// and control normalization based on it
irreducible
let qattr = () | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.FunctionalExtensionality.fsti.checked"
],
"interface_file": false,
"source_file": "MiniValeSemantics.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Prims.int | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let pow2_64 =
| 0x10000000000000000 | false |
|
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_qcode_Cswap2_stdcall | val va_qcode_Cswap2_stdcall (va_mods: va_mods_t) (win: bool) (bit_in: nat64) (p0_b p1_b: buffer64)
: (va_quickCode unit (va_code_Cswap2_stdcall win)) | val va_qcode_Cswap2_stdcall (va_mods: va_mods_t) (win: bool) (bit_in: nat64) (p0_b p1_b: buffer64)
: (va_quickCode unit (va_code_Cswap2_stdcall win)) | let va_qcode_Cswap2_stdcall (va_mods:va_mods_t) (win:bool) (bit_in:nat64) (p0_b:buffer64)
(p1_b:buffer64) : (va_quickCode unit (va_code_Cswap2_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(p0_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s)
(fun _ -> va_get_reg64 rRsi va_s) in let (p1_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in let
(old_p0_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 0 (va_get_mem va_s) in
let (old_p0_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 1 (va_get_mem va_s)
in let (old_p0_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem
va_s) in let (old_p0_3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 3
(va_get_mem va_s) in let (old_p0_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
4 (va_get_mem va_s) in let (old_p0_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b 5 (va_get_mem va_s) in let (old_p0_6:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_s) in let (old_p0_7:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem va_s) in let
(old_p1_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 0 (va_get_mem va_s) in
let (old_p1_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 1 (va_get_mem va_s)
in let (old_p1_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem
va_s) in let (old_p1_3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 3
(va_get_mem va_s) in let (old_p1_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b
4 (va_get_mem va_s) in let (old_p1_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p1_b 5 (va_get_mem va_s) in let (old_p1_6:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_s) in let (old_p1_7:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 1067 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1070 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1071 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1072 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1073 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1074 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 1077 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap2 bit_in p0_b p1_b) (fun (va_s:va_state) _ -> va_QBind va_range1
"***** PRECONDITION NOT MET AT line 1079 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1081 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1082 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun
(va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 89,
"end_line": 2070,
"start_col": 0,
"start_line": 2024
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_r14:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR14 va_x_r14 (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx
(va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64
rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))))) in va_get_ok va_sM
/\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet
0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_mul1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_mul1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_mul1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_mul1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1
())) =
(va_QProc (va_code_Fast_mul1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14;
va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Fast_mul1 dst_b inA_b)
(va_wpProof_Fast_mul1 dst_b inA_b))
#pop-options
//--
//-- Fast_add1
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Clear registers to propagate the carry bit"
) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_CCons (va_code_Xor64
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Newline ()) (va_CCons
(va_code_Comment
"Begin addition chain"
) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdx)
(va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons
(va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 8
Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64
rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret))
(va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 24
Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"Return the carry bit in a register"
) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11))
(va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Clear registers to propagate the carry bit"
) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment
"Begin addition chain"
) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRdx) 0
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret) (va_pbool_and (va_codegen_success_Newline ())
(va_pbool_and (va_codegen_success_Comment
"Return the carry bit in a register"
) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64
rR11)) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue
()))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) :
(va_quickCode unit (va_code_Fast_add1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let
(a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let
(a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 224 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0
Secret Mutable])) (fun (va_s:va_state) _ -> va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 228 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 229 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Clear registers to propagate the carry bit"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 230 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 231 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 233 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 234 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 236 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 237 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Begin addition chain"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 238 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 239 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRdx) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 242 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 244 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 245 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 247 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 248 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 250 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 251 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Return the carry bit in a register"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 252 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 254 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1 va_b0 va_s0 dst_b inA_b inB =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64
rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1 va_mods dst_b inA_b inB in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 182 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 215 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 216 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 217 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 218 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 219 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 220 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + va_get_reg64 rRdx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 222 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1 dst_b inA_b inB va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1 (va_code_Fast_add1 ()) va_s0 dst_b inA_b inB in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRax;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_add1_stdcall
#push-options "--z3rlimit 600"
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons
(va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (if win then va_Block (va_CCons
(va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))) else va_Block (va_CNil
())) (va_CCons (va_code_Fast_add1 ()) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64
rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and
(va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (if win then
va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fast_add1 ()) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and
(va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64)
(inB_in:nat64) : (va_quickCode unit (va_code_Fast_add1_stdcall win)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s)
(fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if
win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 323 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 324 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (fun (va_s:va_state) _ -> va_QBind
va_range1
"***** PRECONDITION NOT MET AT line 327 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 328 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 329 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 330 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))
(qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 333 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Fast_add1 dst_b inA_b inB_in) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 335 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 336 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet
0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_add1_stdcall va_mods win dst_b inA_b inB_in in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add1_stdcall win) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 257 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ ->
va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0
18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64
rRsi va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 284 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 285 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 286 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 287 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 289 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 290 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 292 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 294 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 295 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 297 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + inB_in) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 303 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 306 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 307 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 308 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 309 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 310 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 311 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 312 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 313 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 314 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 315 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 316 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 317 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 318 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 320 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Fast_add1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add1_stdcall (va_code_Fast_add1_stdcall win) va_s0 win dst_b
inA_b inB_in in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM
(va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM
(va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM
(va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM
(va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM
(va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))))))))));
va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0;
va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp;
va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx;
va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Fast_sub1
#push-options "--z3rlimit 1200"
val va_code_Fast_sub1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub1 () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8)
(va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11)
(va_const_opr64 0)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CCons
(va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CNil
()))))))))))))))))
val va_codegen_success_Fast_sub1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub1 () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64
0)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Sbb64
(va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 378 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 379 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 381 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 382 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 383 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 385 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 386 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 387 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 389 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 390 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 391 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 393 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 394 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 395 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 398 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 399 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (va_QEmpty
(())))))))))))))))))))
val va_lemma_Fast_sub1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64
rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret
/\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM
(va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 339 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 367 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 368 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 369 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 370 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 371 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 372 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - va_get_reg64 rRcx va_s0) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 373 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 375 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 376 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall
(va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64)
(va_x_r11:nat64) (va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags
va_x_efl (va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10
va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax
(va_upd_mem va_x_mem va_s0))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let
(a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0
va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - va_get_reg64 rRcx va_s0 /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax
va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi
va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_sub1 : dst_b:buffer64 -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub1 dst_b inA_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub1 ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub1 dst_b inA_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub1 (va_code_Fast_sub1 ()) va_s0 dst_b inA_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub1 (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_sub1
())) =
(va_QProc (va_code_Fast_sub1 ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub1 dst_b inA_b) (va_wpProof_Fast_sub1 dst_b inA_b))
#pop-options
//--
//-- Fast_add
#push-options "--z3rlimit 600"
val va_code_Fast_add : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_add () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRcx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rRbx) (va_op_reg_opr64_reg64 rRcx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 24
Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8))
(va_CNil ())))))))))))))))))))))
val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_add () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRcx) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap
(va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRcx) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRcx) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_add (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 521 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 522 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 523 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 525 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRcx) 0 Secret inB_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 526 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 527 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 529 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRcx) 8 Secret inB_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 530 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 531 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 533 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRcx) 16 Secret inB_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 534 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 535 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 537 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx)
(va_op_reg_opr64_reg64 rRcx) 24 Secret inB_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 27 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 538 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 539 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 24 Secret dst_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 541 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_QEmpty
(())))))))))))))))))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\
bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_add va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64
rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem] in
let va_qc = va_qcode_Fast_add va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 474 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 511 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 512 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 513 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 516 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == a + b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 518 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 519 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok;
va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rbx:nat64)
(va_x_heap0:vale_heap) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl
(va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR11 va_x_r11
(va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64
rRax va_x_rax (va_upd_mem va_x_mem va_s0)))))))) in va_get_ok va_sM /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in d == a + b /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) ==> va_k va_sM (())))
val va_wpProof_Fast_add : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_add dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_add dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_add (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_add ())) =
(va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_mem]) (va_wp_Fast_add dst_b inA_b inB_b) (va_wpProof_Fast_add dst_b inA_b inB_b))
#pop-options
//--
//-- Fast_sub
#push-options "--z3rlimit 600"
val va_code_Fast_sub : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_sub () =
(va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16
Secret) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons
(va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24
Secret) (va_CCons (va_code_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_CNil ()))))))))))))))))))))
val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_sub () =
(va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax))
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap
(va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64
rRcx) 0 Secret)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and
(va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ())
(va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Load64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24
Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and
(va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret) (va_pbool_and (va_codegen_success_Adc64Wrap
(va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_sub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) :
(va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2
a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 674 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 677 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 679 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 0 inB_b 0 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 680 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet
0) (va_op_reg64_reg64 rRcx) 0 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 681 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 685 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 8 inB_b 1 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 686 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 8 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 687 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 691 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10)
(va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 16 inB_b 2 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 692 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 16 Secret)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 694 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 696 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11)
(va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRcx) 24 inB_b 3 Secret)
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 697 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRcx) 24 Secret)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 698 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (fun (va_s:va_state) _ -> let (c:bool) =
Vale.X64.Decls.cf (va_get_flags va_s) in va_QBind va_range1
"***** PRECONDITION NOT MET AT line 701 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adc64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state)
_ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 702 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_s == Vale.Curve25519.Fast_defs.bool_bit c) (let
(va_arg41:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit c in 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 rR10 va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 704 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3
va_arg37 va_arg38 va_arg39 va_arg40 va_arg41) (va_QEmpty (()))))))))))))))))))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 ->
inB_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let
(b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0)
in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0
va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3
(va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1
a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in
(Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\
(Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let
(b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0)
in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0
va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2
(va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 =
Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in let d1 =
Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in let d2 =
Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in let d =
Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d - va_mul_nat (va_get_reg64 rRax va_sM)
pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))
[@"opaque_to_smt"]
let va_lemma_Fast_sub va_b0 va_s0 dst_b inA_b inB_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_sub va_mods dst_b inA_b inB_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 627 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1
"***** POSTCONDITION NOT MET AT line 663 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 664 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 665 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 666 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 667 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1
"***** POSTCONDITION NOT MET AT line 668 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d - va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 669 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_reg64 rRax va_sM == 0 \/ va_get_reg64 rRax va_sM == 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 671 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 672 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in (Vale.X64.Decls.buffers_disjoint dst_b inA_b
\/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\
Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0)
(va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRcx va_s0) inB_b 4
(va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64)
(va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_heap0:vale_heap)
(va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_mem_heaplet 0
va_x_heap0 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9
(va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))) in
va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0
va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1
(va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d -
va_mul_nat (va_get_reg64 rRax va_sM) pow2_256 == a - b /\ (va_get_reg64 rRax va_sM == 0 \/
va_get_reg64 rRax va_sM == 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM))
==> va_k va_sM (())))
val va_wpProof_Fast_sub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Fast_sub dst_b inA_b inB_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags;
va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Fast_sub dst_b inA_b inB_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 dst_b inA_b inB_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64
rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Fast_sub (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit
(va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11;
va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_mem])
(va_wp_Fast_sub dst_b inA_b inB_b) (va_wpProof_Fast_sub dst_b inA_b inB_b))
#pop-options
//--
//-- Cswap_single
val va_code_Cswap_single : offset:nat -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap_single offset =
(va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64
rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret) (va_CCons
(va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_CCons (va_code_Cmovc64
(va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 +
offset `op_Multiply` 8) Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_CNil ())))))))))
val va_codegen_success_Cswap_single : offset:nat -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap_single offset =
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRsi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret)
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret)
(va_ttrue ()))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap_single (va_mods:va_mods_t) (offset:nat) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap_single offset)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 839 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8)
(va_op_reg_opr64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 840 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9)
(va_op_reg_opr64_reg64 rRdx) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 841 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 842 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 843 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cmovc64 (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR10)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 844 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRsi)
(va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret p0_b (0 + offset)) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 845 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdx)
(va_op_reg_opr64_reg64 rR9) (0 + offset `op_Multiply` 8) Secret p1_b (0 + offset)) (va_QEmpty
(()))))))))))
val va_lemma_Cswap_single : va_b0:va_code -> va_s0:va_state -> offset:nat -> p0_b:buffer64 ->
p1_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cswap_single offset) va_s0 /\ va_get_ok va_s0 /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p1_val else old_p0_val) /\ p1_val == (if
Vale.X64.Decls.cf (va_get_flags va_sM) then old_p0_val else old_p1_val))) /\ va_state_eq va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM
(va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))
[@"opaque_to_smt"]
let va_lemma_Cswap_single va_b0 va_s0 offset p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9;
va_Mod_reg64 rR8; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap_single va_mods offset p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap_single offset) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 792 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 821 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 822 column 67 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdx va_sM) p1_b 8
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 824 column 57 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 832 column 59 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read p0_b i
(va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet 0
va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 834 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_val = Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 835 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_val = Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 836 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ ->
old_p0_val)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 837 column 63 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_val == va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ ->
old_p1_val)))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@ va_qattr]
let va_wp_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
(0 + offset) (va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in offset < 8 /\
(Vale.X64.Decls.buffers_disjoint p1_b p0_b \/ p1_b == p0_b) /\ Vale.X64.Decls.validDstAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) p0_b 8 (va_get_mem_layout va_s0) Secret
/\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) p1_b 8
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall
(va_x_mem:vale_heap) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_heap0:vale_heap) .
let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9
va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_mem va_x_mem va_s0)))) in va_get_ok va_sM /\ (let
(old_p0_val:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b (0 + offset)
(va_get_mem_heaplet 0 va_s0) in let (old_p1_val:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRsi va_sM) p0_b 8
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdx va_sM) p1_b 8 (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM) /\ (forall (i:nat) . 0 <= i /\ i < 8 /\ i =!= offset ==> Vale.X64.Decls.buffer64_read
p0_b i (va_get_mem_heaplet 0 va_sM) == Vale.X64.Decls.buffer64_read p0_b i (va_get_mem_heaplet
0 va_s0) /\ Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_sM) ==
Vale.X64.Decls.buffer64_read p1_b i (va_get_mem_heaplet 0 va_s0)) /\ (let p0_val =
Vale.X64.Decls.buffer64_read p0_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let p1_val =
Vale.X64.Decls.buffer64_read p1_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in p0_val == va_if
(Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p1_val) (fun _ -> old_p0_val) /\ p1_val
== va_if (Vale.X64.Decls.cf (va_get_flags va_sM)) (fun _ -> old_p0_val) (fun _ -> old_p1_val)))
==> va_k va_sM (())))
val va_wpProof_Cswap_single : offset:nat -> p0_b:buffer64 -> p1_b:buffer64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cswap_single offset p0_b p1_b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cswap_single offset)
([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_mem])
va_s0 va_k ((va_sM, va_f0, va_g))))
[@"opaque_to_smt"]
let va_wpProof_Cswap_single offset p0_b p1_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cswap_single (va_code_Cswap_single offset) va_s0 offset p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM (va_update_mem va_sM
va_s0)))))));
va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
[@ "opaque_to_smt" va_qattr]
let va_quick_Cswap_single (offset:nat) (p0_b:buffer64) (p1_b:buffer64) : (va_quickCode unit
(va_code_Cswap_single offset)) =
(va_QProc (va_code_Cswap_single offset) ([va_Mod_mem_heaplet 0; va_Mod_reg64 rR10; va_Mod_reg64
rR9; va_Mod_reg64 rR8; va_Mod_mem]) (va_wp_Cswap_single offset p0_b p1_b)
(va_wpProof_Cswap_single offset p0_b p1_b))
//--
//-- Cswap2
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap2 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment
"Transfer bit into CF flag"
) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[0], p2[0]"
) (va_CCons (va_code_Cswap_single 0) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[1], p2[1]"
) (va_CCons (va_code_Cswap_single 1) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[2], p2[2]"
) (va_CCons (va_code_Cswap_single 2) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[3], p2[3]"
) (va_CCons (va_code_Cswap_single 3) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[4], p2[4]"
) (va_CCons (va_code_Cswap_single 4) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[5], p2[5]"
) (va_CCons (va_code_Cswap_single 5) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[6], p2[6]"
) (va_CCons (va_code_Cswap_single 6) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment
"cswap p1[7], p2[7]"
) (va_CCons (va_code_Cswap_single 7) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil
()))))))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap2 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment
"Transfer bit into CF flag"
) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64
18446744073709551615)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and
(va_codegen_success_Comment
"cswap p1[0], p2[0]"
) (va_pbool_and (va_codegen_success_Cswap_single 0) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[1], p2[1]"
) (va_pbool_and (va_codegen_success_Cswap_single 1) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[2], p2[2]"
) (va_pbool_and (va_codegen_success_Cswap_single 2) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[3], p2[3]"
) (va_pbool_and (va_codegen_success_Cswap_single 3) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[4], p2[4]"
) (va_pbool_and (va_codegen_success_Cswap_single 4) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[5], p2[5]"
) (va_pbool_and (va_codegen_success_Cswap_single 5) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[6], p2[6]"
) (va_pbool_and (va_codegen_success_Cswap_single 6) (va_pbool_and (va_codegen_success_Newline
()) (va_pbool_and (va_codegen_success_Comment
"cswap p1[7], p2[7]"
) (va_pbool_and (va_codegen_success_Cswap_single 7) (va_pbool_and
(va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Cswap2 (va_mods:va_mods_t) (bit_in:nat64) (p0_b:buffer64) (p1_b:buffer64) :
(va_quickCode unit (va_code_Cswap2 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(old_p0_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 0 (va_get_mem va_s) in
let (old_p0_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 1 (va_get_mem va_s)
in let (old_p0_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem
va_s) in let (old_p0_3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 3
(va_get_mem va_s) in let (old_p0_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
4 (va_get_mem va_s) in let (old_p0_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b 5 (va_get_mem va_s) in let (old_p0_6:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_s) in let (old_p0_7:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem va_s) in let
(old_p1_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 0 (va_get_mem va_s) in
let (old_p1_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 1 (va_get_mem va_s)
in let (old_p1_2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem
va_s) in let (old_p1_3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 3
(va_get_mem va_s) in let (old_p1_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b
4 (va_get_mem va_s) in let (old_p1_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p1_b 5 (va_get_mem va_s) in let (old_p1_6:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_s) in let (old_p1_7:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem va_s) in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 932 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_CreateHeaplets ([declare_buffer64 p0_b 0 Secret Mutable; declare_buffer64 p1_b 0
Secret Mutable])) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 936 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"Transfer bit into CF flag"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 937 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rRdi) (va_const_opr64 18446744073709551615))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 939 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 940 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[0], p2[0]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 941 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 0 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 943 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 944 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[1], p2[1]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 945 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 1 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 947 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 948 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[2], p2[2]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 949 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 2 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 951 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 952 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[3], p2[3]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 953 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 3 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 955 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 956 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[4], p2[4]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 957 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 4 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 959 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 960 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[5], p2[5]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 961 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 5 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 963 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 964 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[6], p2[6]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 965 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 6 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 967 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Newline ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 968 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Comment
"cswap p1[7], p2[7]"
) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 969 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap_single 7 p0_b p1_b) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 971 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))))))))))))))))))))))
[@"opaque_to_smt"]
let va_lemma_Cswap2 va_b0 va_s0 bit_in p0_b p1_b =
let (va_mods:va_mods_t) = [va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64
rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdi; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Cswap2 va_mods bit_in p0_b p1_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Cswap2 ()) va_qc va_s0 (fun va_s0 va_sM
va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 848 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (old_p0_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b
0 (va_get_mem va_s0) in let (old_p0_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p0_b 1 (va_get_mem va_s0) in let (old_p0_2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem va_s0) in let (old_p0_3:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p0_b 3 (va_get_mem va_s0) in let
(old_p0_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 4 (va_get_mem va_s0) in
let (old_p0_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 5 (va_get_mem va_s0)
in let (old_p0_6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem
va_s0) in let (old_p0_7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p0_b 7
(va_get_mem va_s0) in let (old_p1_0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b
0 (va_get_mem va_s0) in let (old_p1_1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
p1_b 1 (va_get_mem va_s0) in let (old_p1_2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem va_s0) in let (old_p1_3:Vale.Def.Types_s.nat64)
= Vale.X64.Decls.buffer64_read p1_b 3 (va_get_mem va_s0) in let
(old_p1_4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 4 (va_get_mem va_s0) in
let (old_p1_5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 5 (va_get_mem va_s0)
in let (old_p1_6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem
va_s0) in let (old_p1_7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read p1_b 7
(va_get_mem va_s0) in label va_range1
"***** POSTCONDITION NOT MET AT line 894 column 53 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer_2 p0_b p1_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_0 = Vale.X64.Decls.buffer64_read p0_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 897 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_1 = Vale.X64.Decls.buffer64_read p0_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 898 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_2 = Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 899 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_3 = Vale.X64.Decls.buffer64_read p0_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 900 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_4 = Vale.X64.Decls.buffer64_read p0_b 4 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 901 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_5 = Vale.X64.Decls.buffer64_read p0_b 5 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 902 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_6 = Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 903 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p0_7 = Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 905 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_0 = Vale.X64.Decls.buffer64_read p1_b 0 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 906 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_1 = Vale.X64.Decls.buffer64_read p1_b 1 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 907 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_2 = Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 908 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_3 = Vale.X64.Decls.buffer64_read p1_b 3 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 909 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_4 = Vale.X64.Decls.buffer64_read p1_b 4 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 910 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_5 = Vale.X64.Decls.buffer64_read p1_b 5 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 911 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_6 = Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 912 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let p1_7 = Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 914 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_0 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_0) (fun _ -> old_p0_0)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 915 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_1 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_1) (fun _ -> old_p0_1)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 916 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_2 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_2) (fun _ -> old_p0_2)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 917 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_3 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_3) (fun _ -> old_p0_3)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 918 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_4 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_4) (fun _ -> old_p0_4)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 919 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_5 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_5) (fun _ -> old_p0_5)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 920 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_6 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_6) (fun _ -> old_p0_6)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 921 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p0_7 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p1_7) (fun _ -> old_p0_7)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 923 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_0 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_0) (fun _ -> old_p1_0)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 924 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_1 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_1) (fun _ -> old_p1_1)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 925 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_2 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_2) (fun _ -> old_p1_2)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 926 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_3 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_3) (fun _ -> old_p1_3)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 927 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_4 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_4) (fun _ -> old_p1_4)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 928 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_5 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_5) (fun _ -> old_p1_5)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 929 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_6 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_6) (fun _ -> old_p1_6)) /\ label
va_range1
"***** POSTCONDITION NOT MET AT line 930 column 62 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(p1_7 == va_if (va_get_reg64 rRdi va_s0 = 1) (fun _ -> old_p0_7) (fun _ ->
old_p1_7)))))))))))))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdi; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cswap2 bit_in p0_b p1_b va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cswap2 (va_code_Cswap2 ()) va_s0 bit_in p0_b p1_b in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM
(va_update_flags va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64
rR8 va_sM (va_update_reg64 rRdi va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))));
va_lemma_norm_mods ([va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR10;
va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdi; va_Mod_mem]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cswap2_stdcall
[@ "opaque_to_smt" va_qattr]
let va_code_Cswap2_stdcall win =
(va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64
rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64
(va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil
())) (va_CCons (va_code_Cswap2 ()) (va_CCons (if win then va_Block (va_CCons
(va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret
(va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ())))))
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Cswap2_stdcall win =
(va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64
rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx))
(va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8))
(va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Cswap2 ()) (va_pbool_and
(if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi))
(va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else
va_ttrue ()) (va_ttrue ())))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
va_mods: Vale.X64.QuickCode.va_mods_t ->
win: Prims.bool ->
bit_in: Vale.X64.Memory.nat64 ->
p0_b: Vale.X64.Memory.buffer64 ->
p1_b: Vale.X64.Memory.buffer64
-> Vale.X64.QuickCode.va_quickCode Prims.unit
(Vale.Curve25519.X64.FastUtil.va_code_Cswap2_stdcall win) | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.QuickCode.va_mods_t",
"Prims.bool",
"Vale.X64.Memory.nat64",
"Vale.X64.Memory.buffer64",
"Vale.X64.QuickCodes.qblock",
"Prims.unit",
"Prims.Cons",
"Vale.X64.Decls.va_code",
"Vale.X64.QuickCodes.if_code",
"Vale.X64.QuickCodes.block",
"Vale.X64.InsStack.va_code_Push_Secret",
"Vale.X64.Decls.va_op_reg_opr64_reg64",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Machine_s.rRsi",
"Vale.X64.InsBasic.va_code_Mov64",
"Vale.X64.Decls.va_op_dst_opr64_reg64",
"Vale.X64.Decls.va_op_opr64_reg64",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rR8",
"Prims.Nil",
"Vale.X64.Machine_s.precode",
"Vale.X64.Decls.ins",
"Vale.X64.Decls.ocmp",
"Vale.Curve25519.X64.FastUtil.va_code_Cswap2",
"Vale.X64.InsStack.va_code_Pop_Secret",
"Vale.X64.Decls.va_state",
"Vale.X64.QuickCodes.va_QBind",
"Vale.X64.QuickCodes.va_range1",
"Vale.X64.QuickCodes.va_qInlineIf",
"Vale.X64.QuickCodes.va_QSeq",
"Vale.X64.InsStack.va_quick_Push_Secret",
"Vale.X64.InsBasic.va_quick_Mov64",
"Vale.X64.QuickCodes.va_QEmpty",
"Vale.X64.QuickCodes.quickCodes",
"Vale.Curve25519.X64.FastUtil.va_quick_Cswap2",
"Vale.X64.InsStack.va_quick_Pop_Secret",
"Vale.Def.Words_s.nat64",
"Vale.X64.Decls.buffer64_read",
"Vale.X64.Decls.va_get_mem",
"Vale.X64.Decls.va_int_range",
"Vale.X64.Decls.va_if",
"Vale.Def.Types_s.nat64",
"Prims.b2t",
"Vale.X64.Decls.va_get_reg64",
"Prims.l_not",
"Vale.X64.State.vale_state",
"Vale.X64.QuickCode.va_quickCode",
"Vale.Curve25519.X64.FastUtil.va_code_Cswap2_stdcall"
] | [] | false | false | false | false | false | let va_qcode_Cswap2_stdcall (va_mods: va_mods_t) (win: bool) (bit_in: nat64) (p0_b p1_b: buffer64)
: (va_quickCode unit (va_code_Cswap2_stdcall win)) =
| (qblock va_mods
(fun (va_s: va_state) ->
let va_old_s:va_state = va_s in
let p0_in:(va_int_range 0 18446744073709551615) =
va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s)
in
let p1_in:(va_int_range 0 18446744073709551615) =
va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s)
in
let old_p0_0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b 0 (va_get_mem va_s)
in
let old_p0_1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b 1 (va_get_mem va_s)
in
let old_p0_2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b 2 (va_get_mem va_s)
in
let old_p0_3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b 3 (va_get_mem va_s)
in
let old_p0_4:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b 4 (va_get_mem va_s)
in
let old_p0_5:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b 5 (va_get_mem va_s)
in
let old_p0_6:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b 6 (va_get_mem va_s)
in
let old_p0_7:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p0_b 7 (va_get_mem va_s)
in
let old_p1_0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b 0 (va_get_mem va_s)
in
let old_p1_1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b 1 (va_get_mem va_s)
in
let old_p1_2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b 2 (va_get_mem va_s)
in
let old_p1_3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b 3 (va_get_mem va_s)
in
let old_p1_4:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b 4 (va_get_mem va_s)
in
let old_p1_5:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b 5 (va_get_mem va_s)
in
let old_p1_6:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b 6 (va_get_mem va_s)
in
let old_p1_7:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read p1_b 7 (va_get_mem va_s)
in
va_QBind va_range1
"***** PRECONDITION NOT MET AT line 1067 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods
win
(qblock va_mods
(fun (va_s: va_state) ->
va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1070 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1071 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1072 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi)
(va_op_opr64_reg64 rRcx))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1073 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi)
(va_op_opr64_reg64 rRdx))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1074 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx)
(va_op_opr64_reg64 rR8))
(va_QEmpty (()))))))))
(qblock va_mods (fun (va_s: va_state) -> va_QEmpty (()))))
(fun (va_s: va_state) va_g ->
va_QBind va_range1
"***** PRECONDITION NOT MET AT line 1077 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Cswap2 bit_in p0_b p1_b)
(fun (va_s: va_state) _ ->
va_QBind va_range1
"***** PRECONDITION NOT MET AT line 1079 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_qInlineIf va_mods
win
(qblock va_mods
(fun (va_s: va_state) ->
va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1081 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi))
(va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 1082 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi))
(va_QEmpty (())))))
(qblock va_mods (fun (va_s: va_state) -> va_QEmpty (()))))
(fun (va_s: va_state) va_g -> va_QEmpty (())))))) | false |
MiniValeSemantics.fst | MiniValeSemantics.update_state | val update_state (r: reg) (s' s: state) : state | val update_state (r: reg) (s' s: state) : state | let update_state (r:reg) (s' s:state) : state =
update_reg s r (s' r) | {
"file_name": "examples/metatheory/MiniValeSemantics.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 23,
"end_line": 88,
"start_col": 0,
"start_line": 87
} | (*
Copyright 2008-2019 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.
Authors: C. Hawblitzel, N. Swamy
*)
module MiniValeSemantics
(*
This is a highly-simplified model of Vale/F*, based on Section
3.1-3.3 of the paper of the POPL '19 paper.
It is derived from the QuickRegs1 code in the popl-artifact-submit
branch of Vale.
*)
/// We use this tag to mark certain definitions
/// and control normalization based on it
irreducible
let qattr = ()
/// 2^64
let pow2_64 = 0x10000000000000000
/// Natural numbers representable in 64 bits
type nat64 = i:int{0 <= i /\ i < pow2_64}
/// We have 4 registers
type reg = | Rax | Rbx | Rcx | Rdx
/// An operand is either a register or a constant
type operand =
| OReg: r:reg -> operand
| OConst: n:nat64 -> operand
/// Only 2 instructions here:
/// A move or an add
type ins =
| Mov64: dst:operand -> src:operand -> ins
| Add64: dst:operand -> src:operand -> ins
/// A program is
/// - a single instruction
/// - a block of instructions
/// - or a while loop
type code =
| Ins: ins:ins -> code
| Block: block:list code -> code
| WhileLessThan: src1:operand -> src2:operand -> whileBody:code -> code
/// The state of a program is the register file
/// holiding a 64-bit value for each register
type state = reg -> nat64
/// fuel: To prove the termination of while loops, we're going to
/// instrument while loops with fuel
type fuel = nat
/// Evaluating an operand:
/// -- marked for reduction
/// -- Registers evaluated by state lookup
[@@qattr]
let eval_operand (o:operand) (s:state) : nat64 =
match o with
| OReg r -> s r
| OConst n -> n
/// updating a register state `s` at `r` with `v`
[@@qattr]
let update_reg (s:state) (r:reg) (v:nat64) : state =
fun r' -> if r = r' then v else s r'
/// updating a register state `s` at `r` with `s' r` | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.FunctionalExtensionality.fsti.checked"
],
"interface_file": false,
"source_file": "MiniValeSemantics.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | r: MiniValeSemantics.reg -> s': MiniValeSemantics.state -> s: MiniValeSemantics.state
-> MiniValeSemantics.state | Prims.Tot | [
"total"
] | [] | [
"MiniValeSemantics.reg",
"MiniValeSemantics.state",
"MiniValeSemantics.update_reg"
] | [] | false | false | false | true | false | let update_state (r: reg) (s' s: state) : state =
| update_reg s r (s' r) | false |
MiniValeSemantics.fst | MiniValeSemantics.t_post | val t_post : Type | let t_post = state -> Type0 | {
"file_name": "examples/metatheory/MiniValeSemantics.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 27,
"end_line": 213,
"start_col": 0,
"start_line": 213
} | (*
Copyright 2008-2019 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.
Authors: C. Hawblitzel, N. Swamy
*)
module MiniValeSemantics
(*
This is a highly-simplified model of Vale/F*, based on Section
3.1-3.3 of the paper of the POPL '19 paper.
It is derived from the QuickRegs1 code in the popl-artifact-submit
branch of Vale.
*)
/// We use this tag to mark certain definitions
/// and control normalization based on it
irreducible
let qattr = ()
/// 2^64
let pow2_64 = 0x10000000000000000
/// Natural numbers representable in 64 bits
type nat64 = i:int{0 <= i /\ i < pow2_64}
/// We have 4 registers
type reg = | Rax | Rbx | Rcx | Rdx
/// An operand is either a register or a constant
type operand =
| OReg: r:reg -> operand
| OConst: n:nat64 -> operand
/// Only 2 instructions here:
/// A move or an add
type ins =
| Mov64: dst:operand -> src:operand -> ins
| Add64: dst:operand -> src:operand -> ins
/// A program is
/// - a single instruction
/// - a block of instructions
/// - or a while loop
type code =
| Ins: ins:ins -> code
| Block: block:list code -> code
| WhileLessThan: src1:operand -> src2:operand -> whileBody:code -> code
/// The state of a program is the register file
/// holiding a 64-bit value for each register
type state = reg -> nat64
/// fuel: To prove the termination of while loops, we're going to
/// instrument while loops with fuel
type fuel = nat
/// Evaluating an operand:
/// -- marked for reduction
/// -- Registers evaluated by state lookup
[@@qattr]
let eval_operand (o:operand) (s:state) : nat64 =
match o with
| OReg r -> s r
| OConst n -> n
/// updating a register state `s` at `r` with `v`
[@@qattr]
let update_reg (s:state) (r:reg) (v:nat64) : state =
fun r' -> if r = r' then v else s r'
/// updating a register state `s` at `r` with `s' r`
[@@qattr]
let update_state (r:reg) (s' s:state) : state =
update_reg s r (s' r)
// We don't have an "ok" flag, so errors just result an arbitrary state:
assume
val unknown_state (s:state) : state
(*** A basic semantics using
a big-step interpreter
***)
/// Instruction evaluation:
/// only some operands are valid
let eval_ins (ins:ins) (s:state) : state =
match ins with
| Mov64 (OConst _) _ ->
unknown_state s
| Mov64 (OReg dst) src ->
update_reg s dst (eval_operand src s)
| Add64 (OConst _) _ ->
unknown_state s
| Add64 (OReg dst) src ->
update_reg s dst ((s dst + eval_operand src s) % 0x10000000000000000)
/// eval_code:
/// A fueled big-step interpreter
/// While lops return None when we're out of fuel
let rec eval_code (c:code) (f:fuel) (s:state) : option state =
match c with
| Ins ins ->
Some (eval_ins ins s)
| Block cs ->
eval_codes cs f s
| WhileLessThan src1 src2 body ->
if f = 0 then None
else if eval_operand src1 s < eval_operand src2 s then
match eval_code body f s with
| None -> None
| Some s -> eval_code c (f - 1) s
else Some s
and eval_codes (cs:list code) (f:fuel) (s:state) : option state =
match cs with
| [] -> Some s
| c::cs ->
match eval_code c f s with
| None -> None
| Some s -> eval_codes cs f s
(*** END OF TRUSTED SEMANTICS ***)
////////////////////////////////////////////////////////////////////////////////
/// 1. We prove that increasing the fuel is irrelevant to terminating executions
val increase_fuel (c:code) (s0:state) (f0:fuel) (sN:state) (fN:fuel) : Lemma
(requires
eval_code c f0 s0 == Some sN /\
f0 <= fN)
(ensures
eval_code c fN s0 == Some sN)
(decreases %[f0; c])
val increase_fuels (c:list code) (s0:state) (f0:fuel) (sN:state) (fN:fuel) : Lemma
(requires
eval_code (Block c) f0 s0 == Some sN /\
f0 <= fN)
(ensures
eval_code (Block c) fN s0 == Some sN)
(decreases %[f0; c])
let rec increase_fuel (c:code) (s0:state) (f0:fuel) (sN:state) (fN:fuel) =
match c with
| Ins ins -> ()
| Block l -> increase_fuels l s0 f0 sN fN
| WhileLessThan src1 src2 body ->
if eval_operand src1 s0 < eval_operand src2 s0 then
match eval_code body f0 s0 with
| None -> ()
| Some s1 ->
increase_fuel body s0 f0 s1 fN;
increase_fuel c s1 (f0 - 1) sN (fN - 1)
else ()
and increase_fuels (c:list code) (s0:state) (f0:fuel) (sN:state) (fN:fuel) =
match c with
| [] -> ()
| h::t ->
let Some s1 = eval_code h f0 s0 in
increase_fuel h s0 f0 s1 fN;
increase_fuels t s1 f0 sN fN
/// 2. We can compute the fuel needed to run a sequential composition
/// as the max of the fuel to compute each piece of code in it
let lemma_merge (c:code) (cs:list code) (s0:state) (f0:fuel) (sM:state) (fM:fuel) (sN:state)
: Ghost fuel
(requires
eval_code c f0 s0 == Some sM /\
eval_code (Block cs) fM sM == Some sN)
(ensures fun fN ->
eval_code (Block (c::cs)) fN s0 == Some sN)
=
let f = if f0 > fM then f0 else fM in
increase_fuel c s0 f0 sM f;
increase_fuel (Block cs) sM fM sN f;
f
/////////////////////////////////////////////////////////////////
// Now, we're going to define a verification-condition generator
//
// The main idea is that we're going to:
//
// 1. define a kind of typeclass, that associates with a
// piece of code a weakest-precondition rule for it
//
// 2. Define a WP-generator that computes WPs for each of the
// control constructs of the language, given a program
// represented as the raw code packaged with their typeclass
// instances for computing their WPs
///////////////////////////////////////////////////////////////// | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.FunctionalExtensionality.fsti.checked"
],
"interface_file": false,
"source_file": "MiniValeSemantics.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type | Prims.Tot | [
"total"
] | [] | [
"MiniValeSemantics.state"
] | [] | false | false | false | true | true | let t_post =
| state -> Type0 | false |
|
MiniValeSemantics.fst | MiniValeSemantics.eval_operand | val eval_operand (o: operand) (s: state) : nat64 | val eval_operand (o: operand) (s: state) : nat64 | let eval_operand (o:operand) (s:state) : nat64 =
match o with
| OReg r -> s r
| OConst n -> n | {
"file_name": "examples/metatheory/MiniValeSemantics.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 17,
"end_line": 78,
"start_col": 0,
"start_line": 75
} | (*
Copyright 2008-2019 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.
Authors: C. Hawblitzel, N. Swamy
*)
module MiniValeSemantics
(*
This is a highly-simplified model of Vale/F*, based on Section
3.1-3.3 of the paper of the POPL '19 paper.
It is derived from the QuickRegs1 code in the popl-artifact-submit
branch of Vale.
*)
/// We use this tag to mark certain definitions
/// and control normalization based on it
irreducible
let qattr = ()
/// 2^64
let pow2_64 = 0x10000000000000000
/// Natural numbers representable in 64 bits
type nat64 = i:int{0 <= i /\ i < pow2_64}
/// We have 4 registers
type reg = | Rax | Rbx | Rcx | Rdx
/// An operand is either a register or a constant
type operand =
| OReg: r:reg -> operand
| OConst: n:nat64 -> operand
/// Only 2 instructions here:
/// A move or an add
type ins =
| Mov64: dst:operand -> src:operand -> ins
| Add64: dst:operand -> src:operand -> ins
/// A program is
/// - a single instruction
/// - a block of instructions
/// - or a while loop
type code =
| Ins: ins:ins -> code
| Block: block:list code -> code
| WhileLessThan: src1:operand -> src2:operand -> whileBody:code -> code
/// The state of a program is the register file
/// holiding a 64-bit value for each register
type state = reg -> nat64
/// fuel: To prove the termination of while loops, we're going to
/// instrument while loops with fuel
type fuel = nat
/// Evaluating an operand:
/// -- marked for reduction
/// -- Registers evaluated by state lookup | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.FunctionalExtensionality.fsti.checked"
],
"interface_file": false,
"source_file": "MiniValeSemantics.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | o: MiniValeSemantics.operand -> s: MiniValeSemantics.state -> MiniValeSemantics.nat64 | Prims.Tot | [
"total"
] | [] | [
"MiniValeSemantics.operand",
"MiniValeSemantics.state",
"MiniValeSemantics.reg",
"MiniValeSemantics.nat64"
] | [] | false | false | false | true | false | let eval_operand (o: operand) (s: state) : nat64 =
| match o with
| OReg r -> s r
| OConst n -> n | false |
MiniValeSemantics.fst | MiniValeSemantics.t_wp | val t_wp : Type | let t_wp = t_post -> t_pre | {
"file_name": "examples/metatheory/MiniValeSemantics.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 26,
"end_line": 219,
"start_col": 0,
"start_line": 219
} | (*
Copyright 2008-2019 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.
Authors: C. Hawblitzel, N. Swamy
*)
module MiniValeSemantics
(*
This is a highly-simplified model of Vale/F*, based on Section
3.1-3.3 of the paper of the POPL '19 paper.
It is derived from the QuickRegs1 code in the popl-artifact-submit
branch of Vale.
*)
/// We use this tag to mark certain definitions
/// and control normalization based on it
irreducible
let qattr = ()
/// 2^64
let pow2_64 = 0x10000000000000000
/// Natural numbers representable in 64 bits
type nat64 = i:int{0 <= i /\ i < pow2_64}
/// We have 4 registers
type reg = | Rax | Rbx | Rcx | Rdx
/// An operand is either a register or a constant
type operand =
| OReg: r:reg -> operand
| OConst: n:nat64 -> operand
/// Only 2 instructions here:
/// A move or an add
type ins =
| Mov64: dst:operand -> src:operand -> ins
| Add64: dst:operand -> src:operand -> ins
/// A program is
/// - a single instruction
/// - a block of instructions
/// - or a while loop
type code =
| Ins: ins:ins -> code
| Block: block:list code -> code
| WhileLessThan: src1:operand -> src2:operand -> whileBody:code -> code
/// The state of a program is the register file
/// holiding a 64-bit value for each register
type state = reg -> nat64
/// fuel: To prove the termination of while loops, we're going to
/// instrument while loops with fuel
type fuel = nat
/// Evaluating an operand:
/// -- marked for reduction
/// -- Registers evaluated by state lookup
[@@qattr]
let eval_operand (o:operand) (s:state) : nat64 =
match o with
| OReg r -> s r
| OConst n -> n
/// updating a register state `s` at `r` with `v`
[@@qattr]
let update_reg (s:state) (r:reg) (v:nat64) : state =
fun r' -> if r = r' then v else s r'
/// updating a register state `s` at `r` with `s' r`
[@@qattr]
let update_state (r:reg) (s' s:state) : state =
update_reg s r (s' r)
// We don't have an "ok" flag, so errors just result an arbitrary state:
assume
val unknown_state (s:state) : state
(*** A basic semantics using
a big-step interpreter
***)
/// Instruction evaluation:
/// only some operands are valid
let eval_ins (ins:ins) (s:state) : state =
match ins with
| Mov64 (OConst _) _ ->
unknown_state s
| Mov64 (OReg dst) src ->
update_reg s dst (eval_operand src s)
| Add64 (OConst _) _ ->
unknown_state s
| Add64 (OReg dst) src ->
update_reg s dst ((s dst + eval_operand src s) % 0x10000000000000000)
/// eval_code:
/// A fueled big-step interpreter
/// While lops return None when we're out of fuel
let rec eval_code (c:code) (f:fuel) (s:state) : option state =
match c with
| Ins ins ->
Some (eval_ins ins s)
| Block cs ->
eval_codes cs f s
| WhileLessThan src1 src2 body ->
if f = 0 then None
else if eval_operand src1 s < eval_operand src2 s then
match eval_code body f s with
| None -> None
| Some s -> eval_code c (f - 1) s
else Some s
and eval_codes (cs:list code) (f:fuel) (s:state) : option state =
match cs with
| [] -> Some s
| c::cs ->
match eval_code c f s with
| None -> None
| Some s -> eval_codes cs f s
(*** END OF TRUSTED SEMANTICS ***)
////////////////////////////////////////////////////////////////////////////////
/// 1. We prove that increasing the fuel is irrelevant to terminating executions
val increase_fuel (c:code) (s0:state) (f0:fuel) (sN:state) (fN:fuel) : Lemma
(requires
eval_code c f0 s0 == Some sN /\
f0 <= fN)
(ensures
eval_code c fN s0 == Some sN)
(decreases %[f0; c])
val increase_fuels (c:list code) (s0:state) (f0:fuel) (sN:state) (fN:fuel) : Lemma
(requires
eval_code (Block c) f0 s0 == Some sN /\
f0 <= fN)
(ensures
eval_code (Block c) fN s0 == Some sN)
(decreases %[f0; c])
let rec increase_fuel (c:code) (s0:state) (f0:fuel) (sN:state) (fN:fuel) =
match c with
| Ins ins -> ()
| Block l -> increase_fuels l s0 f0 sN fN
| WhileLessThan src1 src2 body ->
if eval_operand src1 s0 < eval_operand src2 s0 then
match eval_code body f0 s0 with
| None -> ()
| Some s1 ->
increase_fuel body s0 f0 s1 fN;
increase_fuel c s1 (f0 - 1) sN (fN - 1)
else ()
and increase_fuels (c:list code) (s0:state) (f0:fuel) (sN:state) (fN:fuel) =
match c with
| [] -> ()
| h::t ->
let Some s1 = eval_code h f0 s0 in
increase_fuel h s0 f0 s1 fN;
increase_fuels t s1 f0 sN fN
/// 2. We can compute the fuel needed to run a sequential composition
/// as the max of the fuel to compute each piece of code in it
let lemma_merge (c:code) (cs:list code) (s0:state) (f0:fuel) (sM:state) (fM:fuel) (sN:state)
: Ghost fuel
(requires
eval_code c f0 s0 == Some sM /\
eval_code (Block cs) fM sM == Some sN)
(ensures fun fN ->
eval_code (Block (c::cs)) fN s0 == Some sN)
=
let f = if f0 > fM then f0 else fM in
increase_fuel c s0 f0 sM f;
increase_fuel (Block cs) sM fM sN f;
f
/////////////////////////////////////////////////////////////////
// Now, we're going to define a verification-condition generator
//
// The main idea is that we're going to:
//
// 1. define a kind of typeclass, that associates with a
// piece of code a weakest-precondition rule for it
//
// 2. Define a WP-generator that computes WPs for each of the
// control constructs of the language, given a program
// represented as the raw code packaged with their typeclass
// instances for computing their WPs
/////////////////////////////////////////////////////////////////
[@@qattr]
let t_post = state -> Type0
[@@qattr]
let t_pre = state -> Type0 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.FunctionalExtensionality.fsti.checked"
],
"interface_file": false,
"source_file": "MiniValeSemantics.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type | Prims.Tot | [
"total"
] | [] | [
"MiniValeSemantics.t_post",
"MiniValeSemantics.t_pre"
] | [] | false | false | false | true | true | let t_wp =
| t_post -> t_pre | false |
|
MiniValeSemantics.fst | MiniValeSemantics.update_reg | val update_reg (s: state) (r: reg) (v: nat64) : state | val update_reg (s: state) (r: reg) (v: nat64) : state | let update_reg (s:state) (r:reg) (v:nat64) : state =
fun r' -> if r = r' then v else s r' | {
"file_name": "examples/metatheory/MiniValeSemantics.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 38,
"end_line": 83,
"start_col": 0,
"start_line": 82
} | (*
Copyright 2008-2019 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.
Authors: C. Hawblitzel, N. Swamy
*)
module MiniValeSemantics
(*
This is a highly-simplified model of Vale/F*, based on Section
3.1-3.3 of the paper of the POPL '19 paper.
It is derived from the QuickRegs1 code in the popl-artifact-submit
branch of Vale.
*)
/// We use this tag to mark certain definitions
/// and control normalization based on it
irreducible
let qattr = ()
/// 2^64
let pow2_64 = 0x10000000000000000
/// Natural numbers representable in 64 bits
type nat64 = i:int{0 <= i /\ i < pow2_64}
/// We have 4 registers
type reg = | Rax | Rbx | Rcx | Rdx
/// An operand is either a register or a constant
type operand =
| OReg: r:reg -> operand
| OConst: n:nat64 -> operand
/// Only 2 instructions here:
/// A move or an add
type ins =
| Mov64: dst:operand -> src:operand -> ins
| Add64: dst:operand -> src:operand -> ins
/// A program is
/// - a single instruction
/// - a block of instructions
/// - or a while loop
type code =
| Ins: ins:ins -> code
| Block: block:list code -> code
| WhileLessThan: src1:operand -> src2:operand -> whileBody:code -> code
/// The state of a program is the register file
/// holiding a 64-bit value for each register
type state = reg -> nat64
/// fuel: To prove the termination of while loops, we're going to
/// instrument while loops with fuel
type fuel = nat
/// Evaluating an operand:
/// -- marked for reduction
/// -- Registers evaluated by state lookup
[@@qattr]
let eval_operand (o:operand) (s:state) : nat64 =
match o with
| OReg r -> s r
| OConst n -> n
/// updating a register state `s` at `r` with `v` | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.FunctionalExtensionality.fsti.checked"
],
"interface_file": false,
"source_file": "MiniValeSemantics.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | s: MiniValeSemantics.state -> r: MiniValeSemantics.reg -> v: MiniValeSemantics.nat64
-> MiniValeSemantics.state | Prims.Tot | [
"total"
] | [] | [
"MiniValeSemantics.state",
"MiniValeSemantics.reg",
"MiniValeSemantics.nat64",
"Prims.op_Equality",
"Prims.bool"
] | [] | false | false | false | true | false | let update_reg (s: state) (r: reg) (v: nat64) : state =
| fun r' -> if r = r' then v else s r' | false |
MiniValeSemantics.fst | MiniValeSemantics.t_pre | val t_pre : Type | let t_pre = state -> Type0 | {
"file_name": "examples/metatheory/MiniValeSemantics.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 26,
"end_line": 216,
"start_col": 0,
"start_line": 216
} | (*
Copyright 2008-2019 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.
Authors: C. Hawblitzel, N. Swamy
*)
module MiniValeSemantics
(*
This is a highly-simplified model of Vale/F*, based on Section
3.1-3.3 of the paper of the POPL '19 paper.
It is derived from the QuickRegs1 code in the popl-artifact-submit
branch of Vale.
*)
/// We use this tag to mark certain definitions
/// and control normalization based on it
irreducible
let qattr = ()
/// 2^64
let pow2_64 = 0x10000000000000000
/// Natural numbers representable in 64 bits
type nat64 = i:int{0 <= i /\ i < pow2_64}
/// We have 4 registers
type reg = | Rax | Rbx | Rcx | Rdx
/// An operand is either a register or a constant
type operand =
| OReg: r:reg -> operand
| OConst: n:nat64 -> operand
/// Only 2 instructions here:
/// A move or an add
type ins =
| Mov64: dst:operand -> src:operand -> ins
| Add64: dst:operand -> src:operand -> ins
/// A program is
/// - a single instruction
/// - a block of instructions
/// - or a while loop
type code =
| Ins: ins:ins -> code
| Block: block:list code -> code
| WhileLessThan: src1:operand -> src2:operand -> whileBody:code -> code
/// The state of a program is the register file
/// holiding a 64-bit value for each register
type state = reg -> nat64
/// fuel: To prove the termination of while loops, we're going to
/// instrument while loops with fuel
type fuel = nat
/// Evaluating an operand:
/// -- marked for reduction
/// -- Registers evaluated by state lookup
[@@qattr]
let eval_operand (o:operand) (s:state) : nat64 =
match o with
| OReg r -> s r
| OConst n -> n
/// updating a register state `s` at `r` with `v`
[@@qattr]
let update_reg (s:state) (r:reg) (v:nat64) : state =
fun r' -> if r = r' then v else s r'
/// updating a register state `s` at `r` with `s' r`
[@@qattr]
let update_state (r:reg) (s' s:state) : state =
update_reg s r (s' r)
// We don't have an "ok" flag, so errors just result an arbitrary state:
assume
val unknown_state (s:state) : state
(*** A basic semantics using
a big-step interpreter
***)
/// Instruction evaluation:
/// only some operands are valid
let eval_ins (ins:ins) (s:state) : state =
match ins with
| Mov64 (OConst _) _ ->
unknown_state s
| Mov64 (OReg dst) src ->
update_reg s dst (eval_operand src s)
| Add64 (OConst _) _ ->
unknown_state s
| Add64 (OReg dst) src ->
update_reg s dst ((s dst + eval_operand src s) % 0x10000000000000000)
/// eval_code:
/// A fueled big-step interpreter
/// While lops return None when we're out of fuel
let rec eval_code (c:code) (f:fuel) (s:state) : option state =
match c with
| Ins ins ->
Some (eval_ins ins s)
| Block cs ->
eval_codes cs f s
| WhileLessThan src1 src2 body ->
if f = 0 then None
else if eval_operand src1 s < eval_operand src2 s then
match eval_code body f s with
| None -> None
| Some s -> eval_code c (f - 1) s
else Some s
and eval_codes (cs:list code) (f:fuel) (s:state) : option state =
match cs with
| [] -> Some s
| c::cs ->
match eval_code c f s with
| None -> None
| Some s -> eval_codes cs f s
(*** END OF TRUSTED SEMANTICS ***)
////////////////////////////////////////////////////////////////////////////////
/// 1. We prove that increasing the fuel is irrelevant to terminating executions
val increase_fuel (c:code) (s0:state) (f0:fuel) (sN:state) (fN:fuel) : Lemma
(requires
eval_code c f0 s0 == Some sN /\
f0 <= fN)
(ensures
eval_code c fN s0 == Some sN)
(decreases %[f0; c])
val increase_fuels (c:list code) (s0:state) (f0:fuel) (sN:state) (fN:fuel) : Lemma
(requires
eval_code (Block c) f0 s0 == Some sN /\
f0 <= fN)
(ensures
eval_code (Block c) fN s0 == Some sN)
(decreases %[f0; c])
let rec increase_fuel (c:code) (s0:state) (f0:fuel) (sN:state) (fN:fuel) =
match c with
| Ins ins -> ()
| Block l -> increase_fuels l s0 f0 sN fN
| WhileLessThan src1 src2 body ->
if eval_operand src1 s0 < eval_operand src2 s0 then
match eval_code body f0 s0 with
| None -> ()
| Some s1 ->
increase_fuel body s0 f0 s1 fN;
increase_fuel c s1 (f0 - 1) sN (fN - 1)
else ()
and increase_fuels (c:list code) (s0:state) (f0:fuel) (sN:state) (fN:fuel) =
match c with
| [] -> ()
| h::t ->
let Some s1 = eval_code h f0 s0 in
increase_fuel h s0 f0 s1 fN;
increase_fuels t s1 f0 sN fN
/// 2. We can compute the fuel needed to run a sequential composition
/// as the max of the fuel to compute each piece of code in it
let lemma_merge (c:code) (cs:list code) (s0:state) (f0:fuel) (sM:state) (fM:fuel) (sN:state)
: Ghost fuel
(requires
eval_code c f0 s0 == Some sM /\
eval_code (Block cs) fM sM == Some sN)
(ensures fun fN ->
eval_code (Block (c::cs)) fN s0 == Some sN)
=
let f = if f0 > fM then f0 else fM in
increase_fuel c s0 f0 sM f;
increase_fuel (Block cs) sM fM sN f;
f
/////////////////////////////////////////////////////////////////
// Now, we're going to define a verification-condition generator
//
// The main idea is that we're going to:
//
// 1. define a kind of typeclass, that associates with a
// piece of code a weakest-precondition rule for it
//
// 2. Define a WP-generator that computes WPs for each of the
// control constructs of the language, given a program
// represented as the raw code packaged with their typeclass
// instances for computing their WPs
/////////////////////////////////////////////////////////////////
[@@qattr]
let t_post = state -> Type0 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.FunctionalExtensionality.fsti.checked"
],
"interface_file": false,
"source_file": "MiniValeSemantics.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type | Prims.Tot | [
"total"
] | [] | [
"MiniValeSemantics.state"
] | [] | false | false | false | true | true | let t_pre =
| state -> Type0 | false |
|
Vale.Curve25519.X64.FastUtil.fst | Vale.Curve25519.X64.FastUtil.va_lemma_Fast_mul1 | val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))))) | val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))))) | let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64
rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64
rR8; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 ()) va_qc va_s0 (fun va_s0
va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0
(va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let
(a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) in label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3 (va_get_reg64 rRax va_sM) in label
va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0
va_sM))))))))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13;
va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8;
va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM) | {
"file_name": "obj/Vale.Curve25519.X64.FastUtil.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 16,
"end_line": 241,
"start_col": 0,
"start_line": 204
} | module Vale.Curve25519.X64.FastUtil
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.InsMem
open Vale.X64.InsStack
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open FStar.Tactics
open Vale.Curve25519.Fast_defs
open Vale.Curve25519.Fast_lemmas_external
open Vale.Curve25519.FastUtil_helpers
open Vale.X64.CPU_Features_s
#reset-options "--z3rlimit 60"
//-- Fast_mul1
#push-options "--z3rlimit 600"
val va_code_Fast_mul1 : va_dummy:unit -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Fast_mul1 () =
(va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64
rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Store64_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0
Secret) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR11)
(va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR10)
(va_op_opr64_reg64 rR9)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13)
(va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx)
(va_op_opr64_reg64 rR11)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_CCons
(va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax)
(va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0)
(va_op_reg64_reg64 rRsi) 24 Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR14)
(va_op_opr64_reg64 rR13)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_CCons
(va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_CNil
())))))))))))))))))))
val va_codegen_success_Fast_mul1 : va_dummy:unit -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Fast_mul1 () =
(va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and
(va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Xor64
(va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and
(va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 8 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rRbx) 16 Secret) (va_pbool_and
(va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64
(va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13))
(va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0)
(va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR14) 24 Secret) (va_pbool_and
(va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (va_ttrue
()))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Fast_mul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit
(va_code_Fast_mul1 ())) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 91 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 93 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 93 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR9) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (fun (va_s:va_state) _ -> let
(va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let
(va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 93 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg46 va_arg47
va_arg48 a0) (let (old_r8:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 94 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 95 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Xor64 (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rR8)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 96 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 96 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR11) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (fun (va_s:va_state) _ -> let
(va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let
(va_arg43:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 96 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg43 va_arg44
va_arg45 a1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 97 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rR9)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 98 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR10) 8 Secret dst_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 99 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 99 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rRbx) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (fun (va_s:va_state) _ ->
let (va_arg42:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg41:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in let
(va_arg40:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 99 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg40 va_arg41
va_arg42 a2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 100 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRbx) (va_op_opr64_reg64 rR11)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 101 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rRbx) 16 Secret dst_b 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret)
(va_QBind va_range1
"***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR14) (va_opr_code_Mem64
(va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (fun (va_s:va_state) _ ->
let (va_arg39:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let
(va_arg38:Vale.Def.Types_s.nat64) = va_get_reg64 rR14 va_s in let
(va_arg37:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 102 column 99 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg37 va_arg38
va_arg39 a3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 103 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR14) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 104 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi)
(va_op_reg_opr64_reg64 rR14) 24 Secret dst_b 3) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 105 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rR8)) (fun (va_s:va_state)
_ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit
(Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 108 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(carry_bit == 0) (let (va_arg36:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 +
Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat
(va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64
rRdx va_s) a3) in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 109 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(fun (_:unit) -> assert_by_tactic va_arg36 int_canon) (va_QEmpty (())))))))))))))))))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Fast_mul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0
va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2
(va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four
a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/
inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64
rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64
(va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0)
Secret)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0
va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1
(va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read
inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) =
Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b
0 (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1
(va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2
(va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3
(va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_five d0 d1 d2 d3
(va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\
Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4
(va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0
va_s0) (va_get_mem_heaplet 0 va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_mem_heaplet 0 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM
(va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM (va_update_mem va_sM va_s0)))))))))))))) | {
"checked_file": "/",
"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.InsStack.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Curve25519.FastUtil_helpers.fsti.checked",
"Vale.Curve25519.Fast_lemmas_external.fsti.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.Curve25519.X64.FastUtil.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.FastUtil_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_lemmas_external",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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.Curve25519.Fast_defs",
"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.InsStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"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.HeapImpl",
"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.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 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": 600,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst_b: Vale.X64.Memory.buffer64 ->
inA_b: Vale.X64.Memory.buffer64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | Prims.Ghost | [] | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Memory.buffer64",
"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_mem_heaplet",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rR14",
"Vale.X64.Machine_s.rR13",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rR11",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rR9",
"Vale.X64.Machine_s.rR8",
"Vale.X64.Machine_s.rRax",
"Vale.X64.QuickCode.va_Mod_ok",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.list",
"Vale.X64.QuickCode.__proj__QProc__item__mods",
"Vale.Curve25519.X64.FastUtil.va_code_Fast_mul1",
"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.nat",
"Vale.X64.Decls.va_mul_nat",
"Vale.X64.Decls.va_get_reg64",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Decls.validSrcAddrs64",
"Vale.X64.Decls.va_get_mem_heaplet",
"Vale.X64.Machine_s.rRdi",
"Vale.X64.Decls.va_get_mem_layout",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.Decls.modifies_buffer",
"Vale.Curve25519.Fast_defs.pow2_five",
"Vale.Def.Words_s.nat64",
"Vale.X64.Decls.buffer64_read",
"Vale.Curve25519.Fast_defs.pow2_four",
"Vale.X64.QuickCode.quickCode",
"Vale.Curve25519.X64.FastUtil.va_qcode_Fast_mul1"
] | [] | false | false | false | false | false | let va_lemma_Fast_mul1 va_b0 va_s0 dst_b inA_b =
| let va_mods:va_mods_t =
[
va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem
]
in
let va_qc = va_qcode_Fast_mul1 va_mods dst_b inA_b in
let va_sM, va_fM, va_g =
va_wp_sound_code_norm (va_code_Fast_mul1 ())
va_qc
va_s0
(fun va_s0 va_sM va_g ->
let () = va_g in
label va_range1
"***** POSTCONDITION NOT MET AT line 52 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(va_get_ok va_sM) /\
(let a0:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0)
in
let a1:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0)
in
let a2:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0)
in
let a3:Vale.Def.Types_s.nat64 =
Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0)
in
let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in
label va_range1
"***** POSTCONDITION NOT MET AT line 81 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 82 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 83 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) in
label va_range1
"***** POSTCONDITION NOT MET AT line 84 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d3 =
Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)
in
label va_range1
"***** POSTCONDITION NOT MET AT line 85 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(let d =
Vale.Curve25519.Fast_defs.pow2_five d0
d1
d2
d3
(va_get_reg64 rRax va_sM)
in
label va_range1
"***** POSTCONDITION NOT MET AT line 86 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 88 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM)
(va_get_reg64 rRdi va_sM)
dst_b
4
(va_get_mem_layout va_sM)
Secret) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 89 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastUtil.vaf *****"
(Vale.X64.Decls.modifies_buffer dst_b
(va_get_mem_heaplet 0 va_s0)
(va_get_mem_heaplet 0 va_sM)))))))))
in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([
va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rRbx;
va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax;
va_Mod_ok; va_Mod_mem
])
va_sM
va_s0;
(va_sM, va_fM) | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.